Class JSONValueArrayImmutable
- java.lang.Object
-
- com.github.tnakamot.json.value.JSONValue
-
- com.github.tnakamot.json.value.JSONValueStructured
-
- com.github.tnakamot.json.value.JSONValueArray
-
- com.github.tnakamot.json.value.JSONValueArrayImmutable
-
public class JSONValueArrayImmutable extends JSONValueArray
Represents one JSON 'array' value (immutable).Instances of this class are immutable. Any method call that may result in the modification of the array (e.g.
add(JSONValue)results inUnsupportedOperationException.- See Also:
JSONValueArrayMutable
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(int i, JSONValue jsonValue)Deprecated.booleanadd(JSONValue jsonValue)Deprecated.booleanaddAll(int i, @NotNull Collection collection)Deprecated.booleanaddAll(@NotNull Collection collection)Deprecated.voidclear()Deprecated.booleancontains(Object o)booleancontainsAll(@NotNull Collection collection)JSONValueget(int i)intindexOf(Object o)booleanisEmpty()@NotNull Iterator<JSONValue>iterator()intlastIndexOf(Object o)@NotNull ListIterator<JSONValue>listIterator()@NotNull ListIterator<JSONValue>listIterator(int i)JSONValueremove(int i)Deprecated.booleanremove(Object o)Deprecated.booleanremoveAll(@NotNull Collection<?> collection)Deprecated.booleanretainAll(@NotNull Collection<?> collection)Deprecated.JSONValueset(int i, JSONValue jsonValue)Deprecated.intsize()@NotNull List<JSONValue>subList(int i, int i1)@NotNull Object[]toArray()<T> @NotNull T[]toArray(T[] ts)JSONValueArrayMutabletoMutable()Return the copy of this JSON array as a mutable Java object.@NotNull StringtoTokenString()Convert this JSON value toStringwhich can be saved as a JSON text to a file or transmitted to network.@NotNull StringtoTokenString(String newline, String indent)Convert this JSON value toStringwhich can be saved as a JSON text to a file or transmitted to network.-
Methods inherited from class com.github.tnakamot.json.value.JSONValueArray
add, add, add, add, equals, getArray, getBoolean, getDouble, getLong, getObject, getString, hashCode
-
Methods inherited from class com.github.tnakamot.json.value.JSONValueStructured
begin, end
-
Methods inherited from class com.github.tnakamot.json.value.JSONValue
toTokenBytes, toTokenBytes, type
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfaceCollection<JSONValue>- Specified by:
sizein interfaceList<JSONValue>- Specified by:
sizein classJSONValueArray
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<JSONValue>- Specified by:
isEmptyin interfaceList<JSONValue>- Specified by:
isEmptyin classJSONValueArray
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<JSONValue>- Specified by:
containsin interfaceList<JSONValue>- Specified by:
containsin classJSONValueArray
-
toArray
@NotNull public @NotNull Object[] toArray()
- Specified by:
toArrayin interfaceCollection<JSONValue>- Specified by:
toArrayin interfaceList<JSONValue>- Specified by:
toArrayin classJSONValueArray
-
toArray
@NotNull public <T> @NotNull T[] toArray(T[] ts)
- Specified by:
toArrayin interfaceCollection<JSONValue>- Specified by:
toArrayin interfaceList<JSONValue>- Specified by:
toArrayin classJSONValueArray
-
add
@Deprecated public boolean add(JSONValue jsonValue)
Deprecated.- Specified by:
addin interfaceCollection<JSONValue>- Specified by:
addin interfaceList<JSONValue>- Specified by:
addin classJSONValueArray
-
remove
@Deprecated public boolean remove(Object o)
Deprecated.- Specified by:
removein interfaceCollection<JSONValue>- Specified by:
removein interfaceList<JSONValue>- Specified by:
removein classJSONValueArray
-
containsAll
public boolean containsAll(@NotNull @NotNull Collection collection)- Specified by:
containsAllin interfaceCollection<JSONValue>- Specified by:
containsAllin interfaceList<JSONValue>- Specified by:
containsAllin classJSONValueArray
-
addAll
@Deprecated public boolean addAll(@NotNull @NotNull Collection collection)
Deprecated.- Specified by:
addAllin interfaceCollection<JSONValue>- Specified by:
addAllin interfaceList<JSONValue>- Specified by:
addAllin classJSONValueArray
-
addAll
@Deprecated public boolean addAll(int i, @NotNull @NotNull Collection collection)
Deprecated.- Specified by:
addAllin interfaceList<JSONValue>- Specified by:
addAllin classJSONValueArray
-
clear
@Deprecated public void clear()
Deprecated.- Specified by:
clearin interfaceCollection<JSONValue>- Specified by:
clearin interfaceList<JSONValue>- Specified by:
clearin classJSONValueArray
-
get
public JSONValue get(int i)
- Specified by:
getin interfaceList<JSONValue>- Specified by:
getin classJSONValueArray
-
set
@Deprecated public JSONValue set(int i, JSONValue jsonValue)
Deprecated.- Specified by:
setin interfaceList<JSONValue>- Specified by:
setin classJSONValueArray
-
add
@Deprecated public void add(int i, JSONValue jsonValue)
Deprecated.- Specified by:
addin interfaceList<JSONValue>- Specified by:
addin classJSONValueArray
-
remove
@Deprecated public JSONValue remove(int i)
Deprecated.- Specified by:
removein interfaceList<JSONValue>- Specified by:
removein classJSONValueArray
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOfin interfaceList<JSONValue>- Specified by:
indexOfin classJSONValueArray
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<JSONValue>- Specified by:
lastIndexOfin classJSONValueArray
-
listIterator
@NotNull public @NotNull ListIterator<JSONValue> listIterator()
- Specified by:
listIteratorin interfaceList<JSONValue>- Specified by:
listIteratorin classJSONValueArray
-
listIterator
@NotNull public @NotNull ListIterator<JSONValue> listIterator(int i)
- Specified by:
listIteratorin interfaceList<JSONValue>- Specified by:
listIteratorin classJSONValueArray
-
subList
@NotNull public @NotNull List<JSONValue> subList(int i, int i1)
- Specified by:
subListin interfaceList<JSONValue>- Specified by:
subListin classJSONValueArray
-
retainAll
@Deprecated public boolean retainAll(@NotNull @NotNull Collection<?> collection)
Deprecated.- Specified by:
retainAllin interfaceCollection<JSONValue>- Specified by:
retainAllin interfaceList<JSONValue>- Specified by:
retainAllin classJSONValueArray
-
removeAll
@Deprecated public boolean removeAll(@NotNull @NotNull Collection<?> collection)
Deprecated.- Specified by:
removeAllin interfaceCollection<JSONValue>- Specified by:
removeAllin interfaceList<JSONValue>- Specified by:
removeAllin classJSONValueArray
-
toMutable
public JSONValueArrayMutable toMutable()
Return the copy of this JSON array as a mutable Java object.All inner JSON objects and JSON arrays are also turned to be mutable.
- Returns:
- a mutable version of the same JSON array.
-
toTokenString
@NotNull public @NotNull String toTokenString()
Description copied from class:JSONValueConvert this JSON value toStringwhich can be saved as a JSON text to a file or transmitted to network. The output text is optimized for machine, so no indent or new lines will be inserted.Note that, according to RFC 8259 - 8.1 Character Encoding, your application program must encode the returned String using UTF-8 without BOM before writing the returned
Stringto a file or a network stream, or network datagram(s). It is caller's responsibility to correctly encode it.- Specified by:
toTokenStringin classJSONValue- Returns:
- a string representation of this JSON value
-
toTokenString
@NotNull public @NotNull String toTokenString(String newline, String indent)
Description copied from class:JSONValueConvert this JSON value toStringwhich can be saved as a JSON text to a file or transmitted to network. The output text is optimized for human. Indents and new line characters are inserted accordingly.Note that, according to RFC 8259 - 8.1 Character Encoding, your application program must encode the returned String using UTF-8 without BOM before writing the returned
Stringto a file or a network stream, or network datagram(s). It is caller's responsibility to correctly encode it.- Specified by:
toTokenStringin classJSONValue- Parameters:
newline- line separator; "\r", "\n" or "\r\n"indent- indent string. Must consist of " " and "\t".- Returns:
- a string representation of this JSON value
-
-