org.msgpack.value.impl
Class AbstractValueRef

java.lang.Object
  extended by org.msgpack.value.impl.AbstractValueRef
All Implemented Interfaces:
ValueRef
Direct Known Subclasses:
AbstractValue, ArrayCursorImpl, ExtHolder, FloatHolder, IntegerHolder, MapCursorImpl, RawHolder

public abstract class AbstractValueRef
extends java.lang.Object
implements ValueRef

Base implementation of message pack values


Field Summary
protected static int NUMBER_TYPE_MASK
           
protected static int RAW_TYPE_MASK
           
 
Constructor Summary
AbstractValueRef()
           
 
Method Summary
protected
<E extends Value>
E
as(java.lang.Class<E> valueClass, int bitMask)
           
protected
<E extends Value>
E
as(java.lang.Class<E> valueClass, ValueType vt)
           
 ArrayValue asArrayValue()
           
 BinaryValue asBinary()
           
 BooleanValue asBoolean()
           
 ExtendedValue asExtended()
           
 FloatValue asFloat()
           
 IntegerValue asInteger()
           
 MapValue asMapValue()
           
 NilValue asNil()
           
 NumberValue asNumber()
           
 RawValue asRaw()
           
 StringValue asString()
           
 ArrayCursor getArrayCursor()
           
 MapCursor getMapCursor()
           
 boolean isArray()
           
 boolean isBinary()
           
 boolean isBoolean()
           
 boolean isExtended()
           
 boolean isFloat()
           
 boolean isInteger()
           
 boolean isMap()
           
 boolean isNil()
           
 boolean isNumber()
           
 boolean isRaw()
           
 boolean isRef()
          Test whether this value is a reference of not.
 boolean isString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.msgpack.value.ValueRef
accept, getValueType, toValue, writeTo
 

Field Detail

NUMBER_TYPE_MASK

protected static int NUMBER_TYPE_MASK

RAW_TYPE_MASK

protected static int RAW_TYPE_MASK
Constructor Detail

AbstractValueRef

public AbstractValueRef()
Method Detail

isRef

public boolean isRef()
Description copied from interface: ValueRef
Test whether this value is a reference of not.

Specified by:
isRef in interface ValueRef
Returns:
true if this value is reference, otherwise false.

as

protected <E extends Value> E as(java.lang.Class<E> valueClass,
                                 ValueType vt)

as

protected <E extends Value> E as(java.lang.Class<E> valueClass,
                                 int bitMask)

asNil

public NilValue asNil()
               throws MessageTypeException
Specified by:
asNil in interface ValueRef
Throws:
MessageTypeException

asBoolean

public BooleanValue asBoolean()
                       throws MessageTypeException
Specified by:
asBoolean in interface ValueRef
Throws:
MessageTypeException

asNumber

public NumberValue asNumber()
                     throws MessageTypeException
Specified by:
asNumber in interface ValueRef
Throws:
MessageTypeException

asInteger

public IntegerValue asInteger()
                       throws MessageTypeException
Specified by:
asInteger in interface ValueRef
Throws:
MessageTypeException

asFloat

public FloatValue asFloat()
                   throws MessageTypeException
Specified by:
asFloat in interface ValueRef
Throws:
MessageTypeException

asBinary

public BinaryValue asBinary()
                     throws MessageTypeException
Specified by:
asBinary in interface ValueRef
Throws:
MessageTypeException

asString

public StringValue asString()
                     throws MessageTypeException
Specified by:
asString in interface ValueRef
Throws:
MessageTypeException

asRaw

public RawValue asRaw()
               throws MessageTypeException
Specified by:
asRaw in interface ValueRef
Throws:
MessageTypeException

asArrayValue

public ArrayValue asArrayValue()
                        throws MessageTypeException
Throws:
MessageTypeException

asMapValue

public MapValue asMapValue()
                    throws MessageTypeException
Throws:
MessageTypeException

asExtended

public ExtendedValue asExtended()
                         throws MessageTypeException
Specified by:
asExtended in interface ValueRef
Throws:
MessageTypeException

getArrayCursor

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

getMapCursor

public MapCursor getMapCursor()
                       throws MessageTypeException
Specified by:
getMapCursor in interface ValueRef
Throws:
MessageTypeException

isNil

public boolean isNil()
Specified by:
isNil in interface ValueRef

isBoolean

public boolean isBoolean()
Specified by:
isBoolean in interface ValueRef

isNumber

public boolean isNumber()
Specified by:
isNumber in interface ValueRef

isInteger

public boolean isInteger()
Specified by:
isInteger in interface ValueRef

isFloat

public boolean isFloat()
Specified by:
isFloat in interface ValueRef

isBinary

public boolean isBinary()
Specified by:
isBinary in interface ValueRef

isString

public boolean isString()
Specified by:
isString in interface ValueRef

isRaw

public boolean isRaw()
Specified by:
isRaw in interface ValueRef

isArray

public boolean isArray()
Specified by:
isArray in interface ValueRef

isMap

public boolean isMap()
Specified by:
isMap in interface ValueRef

isExtended

public boolean isExtended()
Specified by:
isExtended in interface ValueRef