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 void
add(int i, JSONValue jsonValue)
Deprecated.boolean
add(JSONValue jsonValue)
Deprecated.boolean
addAll(int i, @NotNull Collection collection)
Deprecated.boolean
addAll(@NotNull Collection collection)
Deprecated.void
clear()
Deprecated.boolean
contains(Object o)
boolean
containsAll(@NotNull Collection collection)
JSONValue
get(int i)
int
indexOf(Object o)
boolean
isEmpty()
@NotNull Iterator<JSONValue>
iterator()
int
lastIndexOf(Object o)
@NotNull ListIterator<JSONValue>
listIterator()
@NotNull ListIterator<JSONValue>
listIterator(int i)
JSONValue
remove(int i)
Deprecated.boolean
remove(Object o)
Deprecated.boolean
removeAll(@NotNull Collection<?> collection)
Deprecated.boolean
retainAll(@NotNull Collection<?> collection)
Deprecated.JSONValue
set(int i, JSONValue jsonValue)
Deprecated.int
size()
@NotNull List<JSONValue>
subList(int i, int i1)
@NotNull Object[]
toArray()
<T> @NotNull T[]
toArray(T[] ts)
JSONValueArrayMutable
toMutable()
Return the copy of this JSON array as a mutable Java object.@NotNull String
toTokenString()
Convert this JSON value toString
which can be saved as a JSON text to a file or transmitted to network.@NotNull String
toTokenString(String newline, String indent)
Convert this JSON value toString
which 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:
size
in interfaceCollection<JSONValue>
- Specified by:
size
in interfaceList<JSONValue>
- Specified by:
size
in classJSONValueArray
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<JSONValue>
- Specified by:
isEmpty
in interfaceList<JSONValue>
- Specified by:
isEmpty
in classJSONValueArray
-
contains
public boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<JSONValue>
- Specified by:
contains
in interfaceList<JSONValue>
- Specified by:
contains
in classJSONValueArray
-
toArray
@NotNull public @NotNull Object[] toArray()
- Specified by:
toArray
in interfaceCollection<JSONValue>
- Specified by:
toArray
in interfaceList<JSONValue>
- Specified by:
toArray
in classJSONValueArray
-
toArray
@NotNull public <T> @NotNull T[] toArray(T[] ts)
- Specified by:
toArray
in interfaceCollection<JSONValue>
- Specified by:
toArray
in interfaceList<JSONValue>
- Specified by:
toArray
in classJSONValueArray
-
add
@Deprecated public boolean add(JSONValue jsonValue)
Deprecated.- Specified by:
add
in interfaceCollection<JSONValue>
- Specified by:
add
in interfaceList<JSONValue>
- Specified by:
add
in classJSONValueArray
-
remove
@Deprecated public boolean remove(Object o)
Deprecated.- Specified by:
remove
in interfaceCollection<JSONValue>
- Specified by:
remove
in interfaceList<JSONValue>
- Specified by:
remove
in classJSONValueArray
-
containsAll
public boolean containsAll(@NotNull @NotNull Collection collection)
- Specified by:
containsAll
in interfaceCollection<JSONValue>
- Specified by:
containsAll
in interfaceList<JSONValue>
- Specified by:
containsAll
in classJSONValueArray
-
addAll
@Deprecated public boolean addAll(@NotNull @NotNull Collection collection)
Deprecated.- Specified by:
addAll
in interfaceCollection<JSONValue>
- Specified by:
addAll
in interfaceList<JSONValue>
- Specified by:
addAll
in classJSONValueArray
-
addAll
@Deprecated public boolean addAll(int i, @NotNull @NotNull Collection collection)
Deprecated.- Specified by:
addAll
in interfaceList<JSONValue>
- Specified by:
addAll
in classJSONValueArray
-
clear
@Deprecated public void clear()
Deprecated.- Specified by:
clear
in interfaceCollection<JSONValue>
- Specified by:
clear
in interfaceList<JSONValue>
- Specified by:
clear
in classJSONValueArray
-
get
public JSONValue get(int i)
- Specified by:
get
in interfaceList<JSONValue>
- Specified by:
get
in classJSONValueArray
-
set
@Deprecated public JSONValue set(int i, JSONValue jsonValue)
Deprecated.- Specified by:
set
in interfaceList<JSONValue>
- Specified by:
set
in classJSONValueArray
-
add
@Deprecated public void add(int i, JSONValue jsonValue)
Deprecated.- Specified by:
add
in interfaceList<JSONValue>
- Specified by:
add
in classJSONValueArray
-
remove
@Deprecated public JSONValue remove(int i)
Deprecated.- Specified by:
remove
in interfaceList<JSONValue>
- Specified by:
remove
in classJSONValueArray
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interfaceList<JSONValue>
- Specified by:
indexOf
in classJSONValueArray
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<JSONValue>
- Specified by:
lastIndexOf
in classJSONValueArray
-
listIterator
@NotNull public @NotNull ListIterator<JSONValue> listIterator()
- Specified by:
listIterator
in interfaceList<JSONValue>
- Specified by:
listIterator
in classJSONValueArray
-
listIterator
@NotNull public @NotNull ListIterator<JSONValue> listIterator(int i)
- Specified by:
listIterator
in interfaceList<JSONValue>
- Specified by:
listIterator
in classJSONValueArray
-
subList
@NotNull public @NotNull List<JSONValue> subList(int i, int i1)
- Specified by:
subList
in interfaceList<JSONValue>
- Specified by:
subList
in classJSONValueArray
-
retainAll
@Deprecated public boolean retainAll(@NotNull @NotNull Collection<?> collection)
Deprecated.- Specified by:
retainAll
in interfaceCollection<JSONValue>
- Specified by:
retainAll
in interfaceList<JSONValue>
- Specified by:
retainAll
in classJSONValueArray
-
removeAll
@Deprecated public boolean removeAll(@NotNull @NotNull Collection<?> collection)
Deprecated.- Specified by:
removeAll
in interfaceCollection<JSONValue>
- Specified by:
removeAll
in interfaceList<JSONValue>
- Specified by:
removeAll
in 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:JSONValue
Convert this JSON value toString
which 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
String
to a file or a network stream, or network datagram(s). It is caller's responsibility to correctly encode it.- Specified by:
toTokenString
in classJSONValue
- Returns:
- a string representation of this JSON value
-
toTokenString
@NotNull public @NotNull String toTokenString(String newline, String indent)
Description copied from class:JSONValue
Convert this JSON value toString
which 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
String
to a file or a network stream, or network datagram(s). It is caller's responsibility to correctly encode it.- Specified by:
toTokenString
in 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
-
-