public class JsonKeyIterator
extends java.lang.Object
implements java.util.Iterator<java.lang.String>
Iterator
takes a JSONObject
and iterates over its keys. In
contrast to JSONObject.keys()
, this Iterator will always return Strings instead of
generic Objects, so it prevents unchecked casts. If the value returned from JSONObject.keys()
's Iterator.next()
method is no String (which probably cannot happen),
the next()
method will throw a IllegalArgumentException
.Constructor and Description |
---|
JsonKeyIterator(org.json.JSONObject object) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
java.lang.String |
next() |
void |
remove() |
public boolean hasNext()
hasNext
in interface java.util.Iterator<java.lang.String>
public java.lang.String next()
next
in interface java.util.Iterator<java.lang.String>
public void remove()
remove
in interface java.util.Iterator<java.lang.String>