diff --git a/JSONArray.java b/JSONArray.java index b5a2dd4bf..720d38e27 100644 --- a/JSONArray.java +++ b/JSONArray.java @@ -79,7 +79,7 @@ of this software and associated documentation files (the "Software"), to deal * @author JSON.org * @version 2012-11-13 */ -public class JSONArray { +public class JSONArray implements Iterable { /** @@ -95,6 +95,15 @@ public JSONArray() { this.myArrayList = new ArrayList(); } + /** + * Iteraror + * @return Iterator + */ + @Override + public Iterator iterator() { + return myArrayList.iterator(); + } + /** * Construct a JSONArray from a JSONTokener. * @param x A JSONTokener