Package org.jdrupes.json
Class JsonArray.DefaultJsonArray
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Object>
-
- org.jdrupes.json.JsonArray.DefaultJsonArray
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Object>
,Collection<Object>
,List<Object>
,RandomAccess
,JsonArray
- Enclosing interface:
- JsonArray
public static class JsonArray.DefaultJsonArray extends ArrayList<Object> implements JsonArray
Instances of this class are used as default representations for JSON arrays.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jdrupes.json.JsonArray
JsonArray.DefaultJsonArray, JsonArray.JsonArrayWrapper
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
Fields inherited from interface org.jdrupes.json.JsonArray
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description DefaultJsonArray()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonArray
append(Object value)
Stream<JsonArray>
arrayStream()
Streams the elements in the array after casting them toJsonArray
s.JsonArray
asArray(int index)
boolean
asBoolean(int index)
double
asDouble(int index)
float
asFloat(int index)
int
asInt(int index)
long
asLong(int index)
String
asString(int index)
List<Object>
backing()
Stream<Object>
stream()
Streams the elements in the array.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
DefaultJsonArray
public DefaultJsonArray()
-
-
Method Detail
-
stream
public Stream<Object> stream()
Description copied from interface:JsonArray
Streams the elements in the array.- Specified by:
stream
in interfaceCollection<Object>
- Specified by:
stream
in interfaceJsonArray
- Returns:
- the stream
-
arrayStream
public Stream<JsonArray> arrayStream()
Description copied from interface:JsonArray
Streams the elements in the array after casting them toJsonArray
s.Useful for processing arrays of arrays.
- Specified by:
arrayStream
in interfaceJsonArray
- Returns:
- the stream
-
-