Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


com.tangosol.io.pof.reflect
Interface PofValue

All Known Implementing Classes:
AbstractPofValue, ComplexPofValue, PofArray, PofCollection, PofSparseArray, PofSparseArray.NilPofValue, PofUniformArray, PofUniformCollection, PofUniformSparseArray, PofUserType, SimplePofValue

public interface PofValue

PofValue represents the POF data structure in a POF stream, or any sub-structure or value thereof.

Since:
Coherence 3.5
Author:
as 2009.02.12
See Also:
PofValueParser.parse(ReadBuffer, PofContext)

Method Summary
 Binary applyChanges()
          Apply all the changes that were made to this value and return a binary representation of the new value.
 ReadBuffer getChanges()
          Return a buffer containing changes made to this PofValue in the format defined by the BinaryDeltaCompressor.
 PofValue getChild(int nIndex)
          Locate a child PofValue contained within this PofValue.
 PofValue getParent()
          Return the parent of this value.
 PofValue getRoot()
          Return the root of the hierarchy this value belongs to.
 int getTypeId()
          Obtain the POF type identifier for this value.
 Object getValue()
          Return the deserialized value which this PofValue represents.
 Object getValue(Class clz)
          Return the deserialized value which this PofValue represents.
 Object getValue(int nType)
          Return the deserialized value which this PofValue represents.
 void setValue(Object oValue)
          Update this PofValue.

 

Method Detail

getTypeId

int getTypeId()
Obtain the POF type identifier for this value.
Returns:
POF type identifier for this value

getRoot

PofValue getRoot()
Return the root of the hierarchy this value belongs to.
Returns:
the root value

getParent

PofValue getParent()
Return the parent of this value.
Returns:
the parent value, or null if this is root value

getChild

PofValue getChild(int nIndex)
Locate a child PofValue contained within this PofValue. <p/> Note: the returned PofValue could represent a non-existent (null) value.
Parameters:
nIndex - index of the child value
Returns:
the child PofValue
Throws:
PofNavigationException - if this value is a "terminal" or the child value cannot be located for any other reason

getValue

Object getValue()
Return the deserialized value which this PofValue represents.
Returns:
the deserialized value

getValue

Object getValue(Class clz)
Return the deserialized value which this PofValue represents.
Parameters:
clz - the required class of the returned value or null if the class is to be inferred from the serialized state
Returns:
the deserialized value
Throws:
ClassCastException - if the value is incompatible with the specified class

getValue

Object getValue(int nType)
Return the deserialized value which this PofValue represents.
Parameters:
nType - the required Pof type of the returned value or PofConstants.T_UNKNOWN if the type is to be inferred from the serialized state
Returns:
the deserialized value
Throws:
ClassCastException - if the value is incompatible with the specified type

setValue

void setValue(Object oValue)
Update this PofValue. <p/> The changes made using this method will be immediately reflected in the result of getValue() method, but will not be applied to the underlying POF stream until the applyChanges() method is invoked on the root PofValue.
Parameters:
oValue - new deserialized value for this PofValue

applyChanges

Binary applyChanges()
Apply all the changes that were made to this value and return a binary representation of the new value. <p/> Any format prefixes and/or decorations that were present in the original buffer this value orginated from will be preserved. <p/> Note: this method can only be called on the root PofValue.
Returns:
new Binary object that contains modified PofValue
Throws:
UnsupportedOperationException - if called on a non-root PofValue

getChanges

ReadBuffer getChanges()
Return a buffer containing changes made to this PofValue in the format defined by the BinaryDeltaCompressor. <p/> Note: this method can only be called on the root PofValue
Returns:
a buffer containing changes made to this PofValue
Throws:
UnsupportedOperationException - if called on a non-root PofValue

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.6.0.0

E15725-01


Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.