- java.lang.Object
-
- org.shredzone.acme4j.toolbox.JSON.Array
-
- All Implemented Interfaces:
Iterable<JSON.Value>
- Enclosing class:
- JSON
public static final class JSON.Array extends Object implements Iterable<JSON.Value>
Represents a JSON array.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSON.Value
get(int index)
Gets theJSON.Value
at the given index.boolean
isEmpty()
Returnstrue
if the array is empty.Iterator<JSON.Value>
iterator()
Creates a newIterator
that iterates over the arrayJSON.Value
.int
size()
Returns the array size.Stream<JSON.Value>
stream()
Returns a stream of values.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
size
public int size()
Returns the array size.- Returns:
- Size of the array
-
isEmpty
public boolean isEmpty()
Returnstrue
if the array is empty.
-
get
public JSON.Value get(int index)
Gets theJSON.Value
at the given index.- Parameters:
index
- Array index to read from- Returns:
JSON.Value
at this index
-
stream
public Stream<JSON.Value> stream()
Returns a stream of values.- Returns:
Stream
of allJSON.Value
of this array
-
iterator
public Iterator<JSON.Value> iterator()
Creates a newIterator
that iterates over the arrayJSON.Value
.- Specified by:
iterator
in interfaceIterable<JSON.Value>
-
-