|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.io.pof.reflect.AbstractPofValue
public abstract class AbstractPofValue
An abstract base class that implements common functionality for all PofValue types.
Field Summary | |
---|---|
protected LongArray |
m_arrayRefs Lazily-constructed mapping of identities to references. |
protected int |
m_nType POF type identifer of this value. |
protected java.lang.Object |
m_oValue Deserialized representation of this value. |
Constructor Summary | |
---|---|
AbstractPofValue(PofValue valueParent, ReadBuffer bufValue, PofContext ctx, int of, int nType) Construct a PofValue instance wrapping the supplied buffer. |
Method Summary | |
---|---|
Binary |
applyChanges() Apply all the changes that were made to this value and return a binary representation of the new value. |
protected LongArray |
ensureReferenceRegistry() Obtain the registry for identity-reference pairs, creating it if necessary. |
java.math.BigDecimal |
getBigDecimal() Return the BigDecimal which this PofValue represents. |
java.math.BigInteger |
getBigInteger() Return the BigInteger which this PofValue represents. |
boolean |
getBoolean() Return the boolean which this PofValue represents. |
boolean[] |
getBooleanArray() Return the boolean[] which this PofValue represents. |
byte |
getByte() Return the byte which this PofValue represents. |
byte[] |
getByteArray() Return the byte[] which this PofValue represents. |
ReadBuffer |
getChanges() Return a buffer containing changes made to this PofValue in the format defined by the BinaryDeltaCompressor . |
char |
getChar() Return the char which this PofValue represents. |
char[] |
getCharArray() Return the char[] which this PofValue represents. |
java.util.Collection |
getCollection(java.util.Collection coll) Return the Collection which this PofValue represents. |
java.util.Date |
getDate() Return the Date which this PofValue represents. |
protected int |
getDirtyBytesCount() Get the estimated number of dirty bytes in this POF value hierarchy. |
double |
getDouble() Return the double which this PofValue represents. |
double[] |
getDoubleArray() Return the double[] which this PofValue represents. |
float |
getFloat() Return the float which this PofValue represents. |
float[] |
getFloatArray() Return the float[] which this PofValue represents. |
int |
getInt() Return the int which this PofValue represents. |
int[] |
getIntArray() Return the int[] which this PofValue represents. |
long |
getLong() Return the long which this PofValue represents. |
long[] |
getLongArray() Return the long[] which this PofValue represents. |
java.util.Map |
getMap(java.util.Map map) Return the Map which this PofValue represents. |
java.lang.Object[] |
getObjectArray() Return the Object[] which this PofValue represents. |
int |
getOffset() Return the offset of this value from the beginning of POF stream. |
protected ReadBuffer |
getOriginalBuffer() Get the original buffer the changes should be applied to. |
PofValue |
getParent() Return the parent of this value. |
PofContext |
getPofContext() Return the POF context to use for serialization and deserialization. |
protected int |
getPropertyIndex() |
PofValue |
getRoot() Return the root of the hierarchy this value belongs to. |
ReadBuffer |
getSerializedValue() Return this value's serialized form. |
short |
getShort() Return the short which this PofValue represents. |
short[] |
getShortArray() Return the short[] which this PofValue represents. |
int |
getSize() Return the size of the encoded value in bytes. |
java.lang.String |
getString() Return the String which this PofValue represents. |
int |
getTypeId() Obtain the POF type identifier for this value. |
java.lang.Object |
getValue() Return the deserialized value which this PofValue represents. |
java.lang.Object |
getValue(java.lang.Class clz) Return the deserialized value which this PofValue represents. |
java.lang.Object |
getValue(int nType) Return the deserialized value which this PofValue represents. |
protected ReadBuffer |
getValueBuffer() Get the raw value buffer. |
protected void |
incrementDirtyBytesCount(int cb) Increment the counter representing the estimated number of bytes in the original buffer that have been modified. |
protected void |
incrementDirtyValuesCount() Increment the counter representing the number of values within this POF hierarchy that have been modified. |
boolean |
isDirty() Return true if this value has been modified, false otherwise. |
protected boolean |
isRoot() Return true if this instance is the root of the PofValue hierarchy. |
protected boolean |
isUniformEncoded() Return true if the buffer contains only the value, without the type identifier. |
protected PofValue |
lookupIdentity(int nId) Look up the specified identity and return the PofValue to which it refers. |
protected void |
registerIdentity(int nId, java.lang.Object oValue) Register the passed value with the passed identity. |
protected void |
setDecorations(long nDecoMask, ReadBuffer bufDeco) Set the decoration mask and decorations for the PofValue. |
protected void |
setDirty() Set the dirty flag for this value. |
protected void |
setOriginalBuffer(ReadBuffer bufValue) Set the original buffer the changes should be applied to. |
protected void |
setUniformEncoded() Specifies that the buffer contains only a value, without a type identifier. |
void |
setValue(java.lang.Object oValue) Update this PofValue. |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Methods inherited from interface com.tangosol.io.pof.reflect.PofValue |
---|
getChild |
Field Detail |
---|
protected LongArray m_arrayRefs
protected int m_nType
protected java.lang.Object m_oValue
Constructor Detail |
---|
public AbstractPofValue(PofValue valueParent, ReadBuffer bufValue, PofContext ctx, int of, int nType)
valueParent
- parent value within the POF streambufValue
- buffer containing POF representation of this valuectx
- POF context to use when reading or writing propertiesof
- offset of this value from the beginning of POF streamnType
- POF type identifier for this valueMethod Detail |
---|
public int getTypeId()
getTypeId
in interface PofValue
public PofValue getRoot()
getRoot
in interface PofValue
public PofValue getParent()
getParent
in interface PofValue
public java.lang.Object getValue()
Note: For primitive types such as int or boolean, the POF type is not stored in the POF stream. Therefore, for primitive types, the type or class must be explicitly specified via PofValue.getValue(int)
or PofValue.getValue(Class)
.
getValue
in interface PofValue
public java.lang.Object getValue(java.lang.Class clz)
Note: For primitive types such as int or boolean, the POF type is not stored in the POF stream. Therefore, for primitive types, the clz parameter must not be null.
getValue
in interface PofValue
clz
- the required class of the returned value or null if the class is to be inferred from the serialized statepublic java.lang.Object getValue(int nType)
Note: For primitive types such as int or boolean, the POF type is not stored in the POF stream. Therefore, for primitive types, the type must be explicitly specified with the nType parameter.
getValue
in interface PofValue
nType
- the required POF type of the returned value or PofConstants.T_UNKNOWN
if the type is to be inferred from the serialized statepublic void setValue(java.lang.Object oValue)
The changes made using this method will be immediately reflected in the result of PofValue.getValue()
method, but will not be applied to the underlying POF stream until the PofValue.applyChanges()
method is invoked on the root PofValue.
setValue
in interface PofValue
oValue
- new deserialized value for this PofValuepublic Binary applyChanges()
Any format prefixes and/or decorations that were present in the original buffer this value orginated from will be preserved.
Note: this method can only be called on the root PofValue.
applyChanges
in interface PofValue
public ReadBuffer getChanges()
BinaryDeltaCompressor
.
Note: this method can only be called on the root PofValue
getChanges
in interface PofValue
public boolean getBoolean()
getBoolean
in interface PofValue
public byte getByte()
getByte
in interface PofValue
public char getChar()
getChar
in interface PofValue
public short getShort()
getShort
in interface PofValue
public int getInt()
getInt
in interface PofValue
public long getLong()
getLong
in interface PofValue
public float getFloat()
getFloat
in interface PofValue
public double getDouble()
getDouble
in interface PofValue
public boolean[] getBooleanArray()
getBooleanArray
in interface PofValue
public byte[] getByteArray()
getByteArray
in interface PofValue
public char[] getCharArray()
getCharArray
in interface PofValue
public short[] getShortArray()
getShortArray
in interface PofValue
public int[] getIntArray()
getIntArray
in interface PofValue
public long[] getLongArray()
getLongArray
in interface PofValue
public float[] getFloatArray()
getFloatArray
in interface PofValue
public double[] getDoubleArray()
getDoubleArray
in interface PofValue
public java.math.BigInteger getBigInteger()
getBigInteger
in interface PofValue
public java.math.BigDecimal getBigDecimal()
getBigDecimal
in interface PofValue
public java.lang.String getString()
getString
in interface PofValue
public java.util.Date getDate()
getDate
in interface PofValue
public java.lang.Object[] getObjectArray()
getObjectArray
in interface PofValue
public java.util.Collection getCollection(java.util.Collection coll)
getCollection
in interface PofValue
coll
- the optional Collection to use to store the valuespublic java.util.Map getMap(java.util.Map map)
getMap
in interface PofValue
map
- the optional Map to use to store the valuespublic PofContext getPofContext()
public int getOffset()
public int getSize()
public boolean isDirty()
protected void setDirty()
public ReadBuffer getSerializedValue()
protected int getPropertyIndex()
protected ReadBuffer getOriginalBuffer()
protected void setOriginalBuffer(ReadBuffer bufValue)
bufValue
- buffer containing the original valueprotected LongArray ensureReferenceRegistry()
protected void registerIdentity(int nId, java.lang.Object oValue)
nId
- the identity within the POF stream of the objectoValue
- the object to associate with the passed identityjava.lang.IllegalArgumentException
- if the specified identity is already registered with a different objectprotected PofValue lookupIdentity(int nId) throws java.io.IOException
nId
- the identityjava.io.IOException
- if the requested identity is not registeredprotected ReadBuffer getValueBuffer()
protected void setDecorations(long nDecoMask, ReadBuffer bufDeco)
nDecoMask
- decoration identifiers bit maskbufDeco
- buffer containing the decorationsprotected boolean isRoot()
protected boolean isUniformEncoded()
protected void setUniformEncoded()
protected int getDirtyBytesCount()
protected void incrementDirtyValuesCount()
protected void incrementDirtyBytesCount(int cb)
cb
- the number of bytes to increment counter for
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |