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:
  • Method Summary

    Modifier and Type
    Method
    Description
    Apply all the changes that were made to this value and return a binary representation of the new value.
    Return the BigDecimal which this PofValue represents.
    Return the BigInteger which this PofValue represents.
    boolean
    Return the boolean which this PofValue represents.
    boolean[]
    Return the boolean[] which this PofValue represents.
    byte
    Return the byte which this PofValue represents.
    byte[]
    Return the byte[] which this PofValue represents.
    Return a buffer containing changes made to this PofValue in the format defined by the BinaryDeltaCompressor.
    char
    Return the char which this PofValue represents.
    char[]
    Return the char[] which this PofValue represents.
    getChild(int nIndex)
    Locate a child PofValue contained within this PofValue.
    Return the Collection which this PofValue represents.
    Return the Date which this PofValue represents.
    double
    Return the double which this PofValue represents.
    double[]
    Return the double[] which this PofValue represents.
    float
    Return the float which this PofValue represents.
    float[]
    Return the float[] which this PofValue represents.
    int
    Return the int which this PofValue represents.
    int[]
    Return the int[] which this PofValue represents.
    long
    Return the long which this PofValue represents.
    long[]
    Return the long[] which this PofValue represents.
    getMap(Map map)
    Return the Map which this PofValue represents.
    Return the Object[] which this PofValue represents.
    Return the parent of this value.
    Return the root of the hierarchy this value belongs to.
    short
    Return the short which this PofValue represents.
    short[]
    Return the short[] which this PofValue represents.
    Return the String which this PofValue represents.
    int
    Obtain the POF type identifier for this value.
    Return the deserialized value which this PofValue represents.
    getValue(int nType)
    Return the deserialized value which this PofValue represents.
    Return the deserialized value which this PofValue represents.
    void
    setValue(Object oValue)
    Update this PofValue.
  • Method Details

    • 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.

      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.

      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 getValue(int) or getValue(Class).

      Returns:
      the deserialized value
    • getValue

      Object getValue(Class clz)
      Return the deserialized value which this PofValue represents.

      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.

      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.

      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.

      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.

      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.

      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.

      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.

      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
    • getBoolean

      boolean getBoolean()
      Return the boolean which this PofValue represents.
      Returns:
      the boolean value
    • getByte

      byte getByte()
      Return the byte which this PofValue represents.
      Returns:
      the byte value
    • getChar

      char getChar()
      Return the char which this PofValue represents.
      Returns:
      the char value
    • getShort

      short getShort()
      Return the short which this PofValue represents.
      Returns:
      the short value
    • getInt

      int getInt()
      Return the int which this PofValue represents.
      Returns:
      the int value
    • getLong

      long getLong()
      Return the long which this PofValue represents.
      Returns:
      the long value
    • getFloat

      float getFloat()
      Return the float which this PofValue represents.
      Returns:
      the float value
    • getDouble

      double getDouble()
      Return the double which this PofValue represents.
      Returns:
      the double value
    • getBooleanArray

      boolean[] getBooleanArray()
      Return the boolean[] which this PofValue represents.
      Returns:
      the boolean[] value
    • getByteArray

      byte[] getByteArray()
      Return the byte[] which this PofValue represents.
      Returns:
      the byte[] value
    • getCharArray

      char[] getCharArray()
      Return the char[] which this PofValue represents.
      Returns:
      the char[] value
    • getShortArray

      short[] getShortArray()
      Return the short[] which this PofValue represents.
      Returns:
      the short[] value
    • getIntArray

      int[] getIntArray()
      Return the int[] which this PofValue represents.
      Returns:
      the int[] value
    • getLongArray

      long[] getLongArray()
      Return the long[] which this PofValue represents.
      Returns:
      the long[] value
    • getFloatArray

      float[] getFloatArray()
      Return the float[] which this PofValue represents.
      Returns:
      the float[] value
    • getDoubleArray

      double[] getDoubleArray()
      Return the double[] which this PofValue represents.
      Returns:
      the double[] value
    • getBigInteger

      BigInteger getBigInteger()
      Return the BigInteger which this PofValue represents.
      Returns:
      the BigInteger value
    • getBigDecimal

      BigDecimal getBigDecimal()
      Return the BigDecimal which this PofValue represents.
      Returns:
      the BigDecimal value
    • getString

      String getString()
      Return the String which this PofValue represents.
      Returns:
      the String value
    • getDate

      Date getDate()
      Return the Date which this PofValue represents.
      Returns:
      the Date value
    • getObjectArray

      Object[] getObjectArray()
      Return the Object[] which this PofValue represents.
      Returns:
      the Object[] value
    • getCollection

      Collection getCollection(Collection coll)
      Return the Collection which this PofValue represents.
      Parameters:
      coll - the optional Collection to use to store the values
      Returns:
      the Collection value
    • getMap

      Map getMap(Map map)
      Return the Map which this PofValue represents.
      Parameters:
      map - the optional Map to use to store the values
      Returns:
      the Map value