private class Variable.ArrayValueAccessor extends Variable.AbstractValueAccessor implements ArrayValue
| Modifier | Constructor and Description |
|---|---|
private |
ArrayValueAccessor() |
| Modifier and Type | Method and Description |
|---|---|
Value[] |
array() |
ArrayValue |
asArrayValue()
Returns the value as
ArrayValue. |
Value |
get(int index)
Returns the element at the specified position in this array.
|
Value |
getOrNilValue(int index)
Returns the element at the specified position in this array.
|
ValueType |
getValueType()
Returns type of this value.
|
ImmutableArrayValue |
immutableValue()
Returns immutable copy of this value.
|
java.util.Iterator<Value> |
iterator()
Returns an iterator over elements.
|
java.util.List<Value> |
list()
Returns the value as
List. |
int |
size()
Returns number of elements in this array.
|
void |
writeTo(MessagePacker pk)
Serializes the value using the specified
MessagePacker |
asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, equals, hashCode, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJson, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitasBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, asTimestampValue, equals, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, toJsonpublic ValueType getValueType()
Valueinstanceof to check type of a value because type of a mutable value is variable.getValueType in interface Valuepublic ArrayValue asArrayValue()
ValueArrayValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((ArrayValue) thisValue) to check type of a value because type of a mutable value is variable.asArrayValue in interface ValueasArrayValue in class Variable.AbstractValueAccessorpublic ImmutableArrayValue immutableValue()
Valuethis without copying the value if this value is already immutable.immutableValue in interface Valuepublic int size()
ArrayValuesize in interface ArrayValuepublic Value get(int index)
ArrayValueget in interface ArrayValuepublic Value getOrNilValue(int index)
ArrayValuegetOrNilValue in interface ArrayValuepublic java.util.Iterator<Value> iterator()
ArrayValueiterator in interface java.lang.Iterable<Value>iterator in interface ArrayValuepublic java.util.List<Value> list()
ArrayValueList.list in interface ArrayValuepublic Value[] array()
public void writeTo(MessagePacker pk) throws java.io.IOException
ValueMessagePackerwriteTo in interface Valuejava.io.IOExceptionMessagePacker