Package org.msgpack.value
Interface ArrayValue
-
- All Known Subinterfaces:
ImmutableArrayValue
- All Known Implementing Classes:
ImmutableArrayValueImpl
public interface ArrayValue extends Value, java.lang.Iterable<Value>
Representation of MessagePack's Array type. MessagePack's Array type can represent sequence of values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.java.util.Iterator<Value>
iterator()
Returns an iterator over elements.java.util.List<Value>
list()
Returns the value asList
.int
size()
Returns number of elements in this array.-
Methods inherited from interface org.msgpack.value.Value
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asRawValue, asStringValue, equals, getValueType, immutableValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, toJson, writeTo
-
-
-
-
Method Detail
-
size
int size()
Returns number of elements in this array.
-
get
Value get(int index)
Returns the element at the specified position in this array.- Throws:
java.lang.IndexOutOfBoundsException
- If the index is out of range (index < 0 || index >= size())
-
getOrNilValue
Value getOrNilValue(int index)
Returns the element at the specified position in this array. This method returns an ImmutableNilValue if the index is out of range.
-
iterator
java.util.Iterator<Value> iterator()
Returns an iterator over elements.- Specified by:
iterator
in interfacejava.lang.Iterable<Value>
-
list
java.util.List<Value> list()
Returns the value asList
.
-
-