Skip to content

Commit 1c7be6d

Browse files
author
Marcus Longmuir
committed
Added listIterator method to provide a way to iterate over contents.
1 parent 13227a5 commit 1c7be6d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

JSONArray.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ of this software and associated documentation files (the "Software"), to deal
3131
import java.util.ArrayList;
3232
import java.util.Collection;
3333
import java.util.Iterator;
34+
import java.util.ListIterator;
3435
import java.util.Map;
3536

3637
/**
@@ -84,14 +85,18 @@ public class JSONArray {
8485
/**
8586
* The arrayList where the JSONArray's properties are kept.
8687
*/
87-
private final ArrayList myArrayList;
88+
public final ArrayList myArrayList;
8889

8990
/**
9091
* Construct an empty JSONArray.
9192
*/
9293
public JSONArray() {
9394
this.myArrayList = new ArrayList();
9495
}
96+
97+
public ListIterator<Object> listIterator(){
98+
return this.myArrayList.listIterator();
99+
}
95100

96101
/**
97102
* Construct a JSONArray from a JSONTokener.

0 commit comments

Comments
 (0)