public final class MutableArray extends Array
Constructor and Description |
---|
MutableArray()
Constructs a new empty Array object.
|
MutableArray(List<Object> data)
Creates a new MutableArray with content from the passed List.
|
MutableArray(String json)
Creates a new MutableArray with content from the passed JSON string.
|
Modifier and Type | Method and Description |
---|---|
MutableArray |
addArray(Array value)
Adds an Array object to the end of the array.
|
MutableArray |
addBlob(Blob value)
Adds a Blob object to the end of the array.
|
MutableArray |
addBoolean(boolean value)
Adds a boolean value to the end of the array.
|
MutableArray |
addDate(Date value)
Adds a Date object to the end of the array.
|
MutableArray |
addDictionary(Dictionary value)
Adds a Dictionary object to the end of the array.
|
MutableArray |
addDouble(double value)
Adds a double value to the end of the array.
|
MutableArray |
addFloat(float value)
Adds a float value to the end of the array.
|
MutableArray |
addInt(int value)
Adds an integer value to the end of the array.
|
MutableArray |
addLong(long value)
Adds a long value to the end of the array.
|
MutableArray |
addNumber(Number value)
Adds a Number object to the end of the array.
|
MutableArray |
addString(String value)
Adds a String object to the end of the array.
|
MutableArray |
addValue(Object value)
Adds an object to the end of the array.
|
int |
count() |
MutableArray |
getArray(int index)
Gets a Array at the given index.
|
Blob |
getBlob(int index) |
boolean |
getBoolean(int index) |
Date |
getDate(int index) |
MutableDictionary |
getDictionary(int index)
Gets a Dictionary at the given index.
|
double |
getDouble(int index) |
float |
getFloat(int index) |
int |
getInt(int index) |
long |
getLong(int index) |
Number |
getNumber(int index) |
String |
getString(int index) |
Object |
getValue(int index) |
MutableArray |
insertArray(int index,
Array value)
Inserts an Array object at the given index.
|
MutableArray |
insertBlob(int index,
Blob value)
Inserts a Blob object at the given index.
|
MutableArray |
insertBoolean(int index,
boolean value)
Inserts a boolean value at the given index.
|
MutableArray |
insertDate(int index,
Date value)
Inserts a Date object at the given index.
|
MutableArray |
insertDictionary(int index,
Dictionary value)
Inserts a Dictionary object at the given index.
|
MutableArray |
insertDouble(int index,
double value)
Inserts a double value at the given index.
|
MutableArray |
insertFloat(int index,
float value)
Inserts a float value at the given index.
|
MutableArray |
insertInt(int index,
int value)
Inserts an integer value at the given index.
|
MutableArray |
insertLong(int index,
long value)
Inserts a long value at the given index.
|
MutableArray |
insertNumber(int index,
Number value)
Inserts a Number object at the given index.
|
MutableArray |
insertString(int index,
String value)
Inserts a String object at the given index.
|
MutableArray |
insertValue(int index,
Object value)
Inserts an object at the given index.
|
MutableArray |
remove(int index)
Removes the object at the given index.
|
MutableArray |
setArray(int index,
Array value)
Sets a Array object at the given index.
|
MutableArray |
setBlob(int index,
Blob value)
Sets a Blob object at the given index.
|
MutableArray |
setBoolean(int index,
boolean value)
Sets a boolean value at the given index.
|
MutableArray |
setData(List<Object> data)
Populate an array with content from a Map.
|
MutableArray |
setDate(int index,
Date value)
Sets a Date object at the given index.
|
MutableArray |
setDictionary(int index,
Dictionary value)
Sets a Dictionary object at the given index.
|
MutableArray |
setDouble(int index,
double value)
Sets a double value at the given index.
|
MutableArray |
setFloat(int index,
float value)
Sets a float value at the given index.
|
MutableArray |
setInt(int index,
int value)
Sets an integer value at the given index.
|
MutableArray |
setJSON(String json)
Populate an array with content from a JSON string.
|
MutableArray |
setLong(int index,
long value)
Sets an integer value at the given index.
|
MutableArray |
setNumber(int index,
Number value)
Sets an NSNumber object at the given index.
|
MutableArray |
setString(int index,
String value)
Sets an String object at the given index.
|
MutableArray |
setValue(int index,
Object value)
Set an object at the given index.
|
String |
toJSON() |
List<Object> |
toList() |
count, encodeTo, equals, getBlob, getBoolean, getDate, getDouble, getFloat, getInt, getLong, getNumber, getString, getValue, hashCode, iterator, toList, toMutable
getClass, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public MutableArray()
public MutableArray(@NonNull List<Object> data)
data
- the document content listpublic MutableArray(@NonNull String json)
json
- the array content as a JSON string.@NonNull public MutableArray setData(@NonNull List<Object> data)
data
- the array@NonNull public MutableArray setJSON(@NonNull String json)
json
- the dictionary object.@NonNull public MutableArray setValue(int index, @Nullable Object value)
index
- the index. This value must not exceed the bounds of the array.value
- the object@NonNull public MutableArray setString(int index, @Nullable String value)
index
- the index. This value must not exceed the bounds of the array.value
- the String object@NonNull public MutableArray setNumber(int index, @Nullable Number value)
index
- the index. This value must not exceed the bounds of the array.value
- the Number object@NonNull public MutableArray setInt(int index, int value)
index
- the index. This value must not exceed the bounds of the array.value
- the int value@NonNull public MutableArray setLong(int index, long value)
index
- the index. This value must not exceed the bounds of the array.value
- the long value@NonNull public MutableArray setFloat(int index, float value)
index
- the index. This value must not exceed the bounds of the array.value
- the float value@NonNull public MutableArray setDouble(int index, double value)
index
- the index. This value must not exceed the bounds of the array.value
- the double value@NonNull public MutableArray setBoolean(int index, boolean value)
index
- the index. This value must not exceed the bounds of the array.value
- the boolean value@NonNull public MutableArray setBlob(int index, @Nullable Blob value)
index
- the index. This value must not exceed the bounds of the array.value
- the Blob object@NonNull public MutableArray setDate(int index, @Nullable Date value)
index
- the index. This value must not exceed the bounds of the array.value
- the Date object@NonNull public MutableArray setArray(int index, @Nullable Array value)
index
- the index. This value must not exceed the bounds of the array.value
- the Array object@NonNull public MutableArray setDictionary(int index, @Nullable Dictionary value)
index
- the index. This value must not exceed the bounds of the array.value
- the Dictionary object@NonNull public MutableArray addValue(@Nullable Object value)
value
- the object@NonNull public MutableArray addString(@Nullable String value)
value
- the String object@NonNull public MutableArray addNumber(@Nullable Number value)
value
- the Number object@NonNull public MutableArray addInt(int value)
value
- the int value@NonNull public MutableArray addLong(long value)
value
- the long value@NonNull public MutableArray addFloat(float value)
value
- the float value@NonNull public MutableArray addDouble(double value)
value
- the double value@NonNull public MutableArray addBoolean(boolean value)
value
- the boolean value@NonNull public MutableArray addBlob(@Nullable Blob value)
value
- the Blob object@NonNull public MutableArray addDate(@Nullable Date value)
value
- the Date object@NonNull public MutableArray addArray(@Nullable Array value)
value
- the Array object@NonNull public MutableArray addDictionary(@Nullable Dictionary value)
value
- the Dictionary object@NonNull public MutableArray insertValue(int index, @Nullable Object value)
index
- the index. This value must not exceed the bounds of the array.value
- the object@NonNull public MutableArray insertString(int index, @Nullable String value)
index
- the index. This value must not exceed the bounds of the array.value
- the String object@NonNull public MutableArray insertNumber(int index, @Nullable Number value)
index
- the index. This value must not exceed the bounds of the array.value
- the Number object@NonNull public MutableArray insertInt(int index, int value)
index
- the index. This value must not exceed the bounds of the array.value
- the int value@NonNull public MutableArray insertLong(int index, long value)
index
- the index. This value must not exceed the bounds of the array.value
- the long value@NonNull public MutableArray insertFloat(int index, float value)
index
- the index. This value must not exceed the bounds of the array.value
- the float value@NonNull public MutableArray insertDouble(int index, double value)
index
- the index. This value must not exceed the bounds of the array.value
- the double value@NonNull public MutableArray insertBoolean(int index, boolean value)
index
- the index. This value must not exceed the bounds of the array.value
- the boolean value@NonNull public MutableArray insertBlob(int index, @Nullable Blob value)
index
- the index. This value must not exceed the bounds of the array.value
- the Blob object@NonNull public MutableArray insertDate(int index, @Nullable Date value)
index
- the index. This value must not exceed the bounds of the array.value
- the Date object@NonNull public MutableArray insertArray(int index, @Nullable Array value)
index
- the index. This value must not exceed the bounds of the array.value
- the Array object@NonNull public MutableArray insertDictionary(int index, @Nullable Dictionary value)
index
- the index. This value must not exceed the bounds of the array.value
- the Dictionary object@NonNull public MutableArray remove(int index)
index
- the index. This value must not exceed the bounds of the array.@Nullable public MutableArray getArray(int index)
@Nullable public MutableDictionary getDictionary(int index)
getDictionary
in class Array
index
- the index. This value must not exceed the bounds of the array.public int count()
public int getInt(int index)
public long getLong(int index)
public float getFloat(int index)
public double getDouble(int index)
public boolean getBoolean(int index)
@Nullable public Number getNumber(int index)
@Nullable public String getString(int index)
@Nullable public Date getDate(int index)
@Nullable public Blob getBlob(int index)
@Nullable public Object getValue(int index)