org.msgpack.value.impl
Class ArrayValueImpl

java.lang.Object
  extended by org.msgpack.value.impl.AbstractValueRef
      extended by org.msgpack.value.impl.AbstractValue
          extended by org.msgpack.value.impl.ArrayValueImpl
All Implemented Interfaces:
java.lang.Iterable<ValueRef>, ArrayCursor, ArrayValue, Value, ValueRef

public class ArrayValueImpl
extends AbstractValue
implements ArrayValue

Created on 5/30/14.


Field Summary
 
Fields inherited from class org.msgpack.value.impl.AbstractValueRef
NUMBER_TYPE_MASK, RAW_TYPE_MASK
 
Constructor Summary
ArrayValueImpl(Value[] array)
           
 
Method Summary
 void accept(ValueVisitor visitor)
           
 Value apply(int index)
           
static ArrayValue empty()
           
 boolean equals(java.lang.Object o)
           
 Value get(int index)
           
 ArrayCursor getArrayCursor()
           
 ValueType getValueType()
           
 int hashCode()
           
 boolean hasNext()
           
 java.util.Iterator<ValueRef> iterator()
           
 ValueRef next()
           
 int size()
           
 void skip()
           
 void skipAll()
          Skips all of the remaining values
 java.lang.String toString()
           
 ArrayValue toValue()
          Create an immutable value from this reference
 Value[] toValueArray()
           
 void writeTo(MessagePacker pk)
           
 
Methods inherited from class org.msgpack.value.impl.AbstractValue
isRef
 
Methods inherited from class org.msgpack.value.impl.AbstractValueRef
as, as, asArrayValue, asBinary, asBoolean, asExtended, asFloat, asInteger, asMapValue, asNil, asNumber, asRaw, asString, getMapCursor, isArray, isBinary, isBoolean, isExtended, isFloat, isInteger, isMap, isNil, isNumber, isRaw, isString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.msgpack.value.Value
asArrayValue, asMapValue
 
Methods inherited from interface org.msgpack.value.ValueRef
asBinary, asBoolean, asExtended, asFloat, asInteger, asNil, asNumber, asRaw, asString, getMapCursor, isArray, isBinary, isBoolean, isExtended, isFloat, isInteger, isMap, isNil, isNumber, isRaw, isRef, isString
 

Constructor Detail

ArrayValueImpl

public ArrayValueImpl(Value[] array)
Method Detail

empty

public static ArrayValue empty()

get

public Value get(int index)
Specified by:
get in interface ArrayValue

apply

public Value apply(int index)
Specified by:
apply in interface ArrayValue

getValueType

public ValueType getValueType()
Specified by:
getValueType in interface ValueRef

getArrayCursor

public ArrayCursor getArrayCursor()
                           throws MessageTypeException
Specified by:
getArrayCursor in interface ValueRef
Overrides:
getArrayCursor in class AbstractValueRef
Throws:
MessageTypeException

writeTo

public void writeTo(MessagePacker pk)
             throws java.io.IOException
Specified by:
writeTo in interface ValueRef
Throws:
java.io.IOException

accept

public void accept(ValueVisitor visitor)
Specified by:
accept in interface ValueRef

toValue

public ArrayValue toValue()
Description copied from interface: ValueRef
Create an immutable value from this reference

Specified by:
toValue in interface ArrayCursor
Specified by:
toValue in interface ArrayValue
Specified by:
toValue in interface ValueRef
Returns:

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

size

public int size()
Specified by:
size in interface ArrayCursor

hasNext

public boolean hasNext()
Specified by:
hasNext in interface ArrayCursor

next

public ValueRef next()
Specified by:
next in interface ArrayCursor

skip

public void skip()
Specified by:
skip in interface ArrayCursor

skipAll

public void skipAll()
Description copied from interface: ArrayCursor
Skips all of the remaining values

Specified by:
skipAll in interface ArrayCursor

toValueArray

public Value[] toValueArray()
Specified by:
toValueArray in interface ArrayValue

iterator

public java.util.Iterator<ValueRef> iterator()
Specified by:
iterator in interface java.lang.Iterable<ValueRef>
Specified by:
iterator in interface ArrayCursor