Skip to content
Commits on Source (2)
libandroid-json-org-java (20121204-20090211-5) unstable; urgency=medium
* Expose "JSONArray implements Iterator<Object>" in the emulated "latest" API.
-- Ximin Luo <infinity0@debian.org> Mon, 26 Nov 2018 22:21:17 -0800
libandroid-json-org-java (20121204-20090211-4) unstable; urgency=medium
* Team upload.
......
......@@ -11,6 +11,39 @@ Index: 20180130/src/main/java/org/json/JSONException.java
public JSONException(String s) {
super(s);
Index: 20180130/src/main/java/org/json/JSONArray.java
===================================================================
--- 20180130.orig/src/main/java/org/json/JSONArray.java
+++ 20180130/src/main/java/org/json/JSONArray.java
@@ -18,6 +18,7 @@ package org.json;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
// Note: this class was written without inspecting the non-free org.json sourcecode.
@@ -44,7 +45,7 @@ import java.util.List;
* <i>Effective Java</i> Item 17, "Design and Document or inheritance or else
* prohibit it" for further information.
*/
-public class JSONArray {
+public class JSONArray implements Iterable<Object> {
private final List<Object> values;
@@ -103,6 +104,11 @@ public class JSONArray {
this(new JSONTokener(json));
}
+ @Override
+ public Iterator<Object> iterator() {
+ return this.values.iterator();
+ }
+
/**
* Returns the number of values in this array.
*/
Index: 20180130/src/main/java/org/json/JSONTokener.java
===================================================================
--- 20180130.orig/src/main/java/org/json/JSONTokener.java
......