public interface Array extends Iterable<Array.Entry>, Comparable<Array>
Values. The array can also be viewed as a stream of Array.Entry instances, each of which contain the
index and the value.| Modifier and Type | Interface and Description |
|---|---|
static interface |
Array.Entry |
| Modifier and Type | Method and Description |
|---|---|
default Array |
add(Array value)
Adds the array value to the end of this array.
|
default Array |
add(BigDecimal value)
Adds the decimal value to the end of this array.
|
default Array |
add(BigInteger value)
Adds the big integer value to the end of this array.
|
default Array |
add(boolean value)
Adds the boolean value to the end of this array.
|
default Array |
add(Boolean value)
Adds the boolean value to the end of this array.
|
default Array |
add(Document value)
Adds the document value to the end of this array.
|
default Array |
add(double value)
Adds the double value to the end of this array.
|
default Array |
add(Double value)
Adds the double value to the end of this array.
|
default Array |
add(float value)
Adds the float value to the end of this array.
|
default Array |
add(Float value)
Adds the float value to the end of this array.
|
default Array |
add(int value)
Adds the integer value to the end of this array.
|
default Array |
add(Integer value)
Adds the integer value to the end of this array.
|
default Array |
add(long value)
Adds the long value to the end of this array.
|
default Array |
add(Long value)
Adds the long value to the end of this array.
|
default Array |
add(String value)
Adds the string value to the end of this array.
|
Array |
add(Value value)
Adds the value to the end of this array.
|
default Array |
addAll(Iterable<Value> values)
Sets on this object all name/value pairs from the supplied object.
|
default Array |
addAll(Object... values)
Sets on this object all name/value pairs from the supplied object.
|
default Array |
addAll(Stream<Value> values)
Sets on this object all name/value pairs from the supplied object.
|
default Array |
addAll(Value... values)
Sets on this object all name/value pairs from the supplied object.
|
default Array |
addNull()
Adds a null value to the end of this array.
|
Array |
clone()
Obtain a complete copy of this array.
|
static Array |
create() |
static Array |
create(Iterable<?> values) |
static Array |
create(List<Value> values) |
static Array |
create(Object... values) |
static Array |
create(Value[] values) |
static Array |
create(Value firstValue,
Value secondValue,
Value... additionalValues) |
static Array |
createWithNulls(int number) |
default Array |
expand(int desiredSize)
If the current size of the array is smaller than the given size, expand it and use a null value for all new entries.
|
default Array |
expand(int desiredSize,
boolean value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
default Array |
expand(int desiredSize,
double value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
default Array |
expand(int desiredSize,
float value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
default Array |
expand(int desiredSize,
int value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
default Array |
expand(int desiredSize,
long value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
default Array |
expand(int desiredSize,
String value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
Array |
expand(int desiredSize,
Value value)
If the current size of the array is smaller than the given size, expand it and use the supplied value for all new entries.
|
Value |
get(int index)
Gets the value in this array at the given index.
|
default Value |
get(int index,
Object defaultValue)
Gets the value in this document for the given field name.
|
boolean |
has(int index)
Determine if this contains an entry at the given index.
|
default Array |
increment(int index,
double increment)
Increment the numeric value at the given location by the designated amount.
|
default Array |
increment(int index,
float increment)
Increment the numeric value at the given location by the designated amount.
|
default Array |
increment(int index,
int increment)
Increment the numeric value at the given location by the designated amount.
|
default Array |
increment(int index,
long increment)
Increment the numeric value at the given location by the designated amount.
|
Array |
increment(int index,
Value increment)
Increment the numeric value at the given location by the designated amount.
|
boolean |
isEmpty()
Return whether this document contains no fields and is therefore empty.
|
default boolean |
isNull(int index)
Determine whether this object has an entry at the given index and the value is null.
|
default boolean |
isNullOrMissing(int index)
Determine whether this object has an entry at the given index and the value is null, or if this object has no entry at
the given index.
|
default Array |
putAll(Iterable<Array.Entry> entries)
Sets on this object all key/value pairs from the supplied map.
|
Value |
remove(int index)
Remove the specified entry from this array
|
Array |
removeAll()
Remove all entries from this array.
|
default Array |
setArray(int index)
Set the value for the field with the given name to be a new, empty array.
|
default Array |
setArray(int index,
Array array)
Set the value for the field with the given name to be the supplied array.
|
default Array |
setArray(int index,
Value... values)
Set the value for the field with the given name to be the supplied array.
|
default Array |
setBinary(int index,
byte[] data)
Set the value for the field with the given name to be a binary value.
|
default Array |
setBoolean(int index,
boolean value)
Set the value for the field with the given name to the supplied boolean value.
|
default Document |
setDocument(int index)
Set the value for the field with the given name to be a new, empty Document.
|
default Document |
setDocument(int index,
Document document)
Set the value for the field with the given name to be the supplied Document.
|
default Array |
setNull(int index)
Set the value for the field with the given name to be a null value.
|
default Array |
setNumber(int index,
BigDecimal value)
Set the value for the field with the given name to the supplied big integer value.
|
default Array |
setNumber(int index,
BigInteger value)
Set the value for the field with the given name to the supplied big integer value.
|
default Array |
setNumber(int index,
double value)
Set the value for the field with the given name to the supplied double value.
|
default Array |
setNumber(int index,
float value)
Set the value for the field with the given name to the supplied float value.
|
default Array |
setNumber(int index,
int value)
Set the value for the field with the given name to the supplied integer value.
|
default Array |
setNumber(int index,
long value)
Set the value for the field with the given name to the supplied long value.
|
default Array |
setString(int index,
String value)
Set the value for the field with the given name to the supplied string value.
|
Array |
setValue(int index,
Value value)
Set the value for the field with the given name to be a value.
|
int |
size()
Return the number of name-value fields in this object.
|
default Stream<Array.Entry> |
streamEntries()
Returns a sequential
Stream with this array as its source. |
default Stream<Value> |
streamValues()
Returns a sequential
Stream with this array as its source. |
default Array |
transform(BiFunction<Integer,Value,Value> transformer)
Transform all of the field values using the supplied
transformer function. |
default Iterable<Value> |
values() |
forEach, iterator, spliteratorcompareTostatic Array create()
static Array createWithNulls(int number)
int size()
boolean isEmpty()
boolean has(int index)
index - the indexValue get(int index)
index - the indexdefault Value get(int index, Object defaultValue)
index - the indexdefaultValue - the default value to return if there is no such entrydefaultValue if there is no such entrydefault boolean isNull(int index)
index - the indextrue if the entry exists but is null, or false otherwiseisNullOrMissing(int)default boolean isNullOrMissing(int index)
index - the indextrue if the field value for the name is null or if there is no such field.isNull(int)Value remove(int index)
index - the indexArray removeAll()
default Array addAll(Object... values)
values - the values to be added to this arraydefault Array addAll(Value... values)
values - the values to be added to this arraydefault Array addAll(Iterable<Value> values)
values - the values to be added to this arraydefault Array addAll(Stream<Value> values)
values - the values to be added to this arrayArray add(Value value)
value - the value; may not be nulldefault Array addNull()
default Array add(String value)
value - the string value; may be null if a null value should be addeddefault Array add(boolean value)
value - the boolean value; may not be nulldefault Array add(Boolean value)
value - the boolean value; may be null if a null value should be addeddefault Array add(int value)
value - the integer value; may not be nulldefault Array add(long value)
value - the long value; may not be nulldefault Array add(float value)
value - the float value; may not be nulldefault Array add(double value)
value - the double value; may not be nulldefault Array add(BigInteger value)
value - the big integer value; may be null if a null value should be addeddefault Array add(BigDecimal value)
value - the decimal value; may be null if a null value should be addeddefault Array add(Integer value)
value - the integer value; may be null if a null value should be addeddefault Array add(Long value)
value - the long value; may be null if a null value should be addeddefault Array add(Float value)
value - the float value; may be null if a null value should be addeddefault Array add(Double value)
value - the double value; may be null if a null value should be addeddefault Array add(Document value)
value - the document value; may be null if a null value should be addeddefault Array add(Array value)
value - the array value; may be null if a null value should be addeddefault Array putAll(Iterable<Array.Entry> entries)
entries - the entries that are to be used to modify this arraydefault Stream<Array.Entry> streamEntries()
Stream with this array as its source.Stream over the elements in this collectiondefault Stream<Value> streamValues()
Stream with this array as its source.Stream over the elements in this collectiondefault Array transform(BiFunction<Integer,Value,Value> transformer)
transformer function.transformer - the transformer that should be used to transform each field value; may not be nulldefault Array setNull(int index)
isNull(int) methods can be used to
determine if a field has been set to null, or isNullOrMissing(int) if the field has not be set or if it has
been set to null.index - the index of the field; must be greater than or equal to 0 or less than or equal to sizeisNull(int),
isNullOrMissing(int)default Array setBoolean(int index, boolean value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setNumber(int index, int value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setNumber(int index, long value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setNumber(int index, float value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setNumber(int index, double value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setNumber(int index, BigInteger value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setNumber(int index, BigDecimal value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setString(int index, String value)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalue - the new value for the fielddefault Array setBinary(int index, byte[] data)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizedata - the bytes for the binary valueArray setValue(int index, Value value)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizevalue - the new valuedefault Array expand(int desiredSize)
desiredSize.desiredSize - the desired size of the array; may be negativeArray expand(int desiredSize, Value value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array expand(int desiredSize, boolean value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array expand(int desiredSize, int value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array expand(int desiredSize, long value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array expand(int desiredSize, float value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array expand(int desiredSize, double value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array expand(int desiredSize, String value)
desiredSize.desiredSize - the desired size of the array; may be negativevalue - the new value for any new entriesdefault Array increment(int index, int increment)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizeincrement - the amount to increment the existing value; may be negative to decrementIllegalArgumentException - if the current value is not a numberdefault Array increment(int index, long increment)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizeincrement - the amount to increment the existing value; may be negative to decrementIllegalArgumentException - if the current value is not a numberdefault Array increment(int index, double increment)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizeincrement - the amount to increment the existing value; may be negative to decrementIllegalArgumentException - if the current value is not a numberdefault Array increment(int index, float increment)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizeincrement - the amount to increment the existing value; may be negative to decrementIllegalArgumentException - if the current value is not a numberArray increment(int index, Value increment)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizeincrement - the amount to increment the existing value; may be negative to decrementIllegalArgumentException - if the current value is not a numberdefault Document setDocument(int index)
index - the index of the field; must be greater than or equal to 0 and less than or equal to sizedefault Document setDocument(int index, Document document)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizedocument - the documentdocument.default Array setArray(int index)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizedefault Array setArray(int index, Array array)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizearray - the arrayarray.default Array setArray(int index, Value... values)
index - the index of the field; must be greater than or equal to 0 or less than or equal to sizevalues - the (valid) values for the arrayarray.Array clone()
Copyright © 2020 JBoss by Red Hat. All rights reserved.