|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.io.pof.PofHelper
com.tangosol.io.pof.PofBufferReader
public class PofBufferReader
PofReader
implementation that reads POF-encoded data from a
BufferInput
.
Nested Class Summary | |
---|---|
static class |
PofBufferReader.UserTypeReader
The UserTypeReader implementation is a contextually-aware PofReader whose purpose is to advance through the properties of a value of a specified user type. |
Nested classes/interfaces inherited from class com.tangosol.io.pof.PofHelper |
---|
PofHelper.ReadableEntrySetMap, PofHelper.WriteableEntrySetMap |
Field Summary | |
---|---|
protected SparseArray |
m_arrayRefs
Lazily-constructed mapping of identities to references. |
protected PofContext |
m_ctx
The PofContext to use to realize user data types as Java objects. |
protected ReadBuffer.BufferInput |
m_in
The BufferInput containing the POF stream. |
Fields inherited from class com.tangosol.io.pof.PofHelper |
---|
BIGDECIMAL_ZERO, BINARY_EMPTY, BOOLEAN_ARRAY_EMPTY, BYTE_ARRAY_EMPTY, CHAR_ARRAY_EMPTY, COLLECTION_EMPTY, DOUBLE_ARRAY_EMPTY, FLOAT_ARRAY_EMPTY, INT_ARRAY_EMPTY, LONG_ARRAY_EMPTY, OBJECT_ARRAY_EMPTY, SHORT_ARRAY_EMPTY |
Constructor Summary | |
---|---|
protected |
PofBufferReader()
|
|
PofBufferReader(ReadBuffer.BufferInput in,
PofContext ctx)
Construct a POF parser that will pull values from the specified stream |
Method Summary | |
---|---|
protected boolean |
advanceTo(int iProp)
Advance through the POF stream until the specified property is found. |
protected void |
complete(int iProp)
Register the completion of the parsing of a value. |
protected SparseArray |
ensureReferenceRegistry()
Obtain the registry for identity-reference pairs, creating it if necessary. |
protected PofBufferReader |
getParentParser()
If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type. |
PofContext |
getPofContext()
Return the PofContext object used by this PofReader to deserialize user types from a POF stream. |
int |
getUserTypeId()
Determine the user type that is currently being parsed. |
int |
getVersionId()
Determine the version identifier of the user type that is currently being parsed. |
protected Object |
lookupIdentity(int nId)
Look up the specified identity and return the object to which it refers. |
protected Object |
readAsObject(int nType)
Read a POF value as an Object. |
protected Object[] |
readAsObjectArray(int nType,
Object[] ao)
Read a POF value as an Object array. |
BigDecimal |
readBigDecimal(int iProp)
Read a BigDecimal from the POF stream. |
BigInteger |
readBigInteger(int iProp)
Read a BigInteger from the POF stream. |
Binary |
readBinary(int iProp)
Read a Binary from the POF stream. |
boolean |
readBoolean(int iProp)
Read a boolean property from the POF stream. |
boolean[] |
readBooleanArray(int iProp)
Read a boolean[] property from the POF stream. |
byte |
readByte(int iProp)
Read a byte property from the POF stream. |
byte[] |
readByteArray(int iProp)
Read a byte[] property from the POF stream. |
char |
readChar(int iProp)
Read a char property from the POF stream. |
char[] |
readCharArray(int iProp)
Read a char[] property from the POF stream. |
Collection |
readCollection(int iProp,
Collection coll)
Read a Collection of object values from the POF stream. |
Date |
readDate(int iProp)
Read a java.util.Date from the POF stream. |
double |
readDouble(int iProp)
Read a double property from the POF stream. |
double[] |
readDoubleArray(int iProp)
Read a double[] property from the POF stream. |
float |
readFloat(int iProp)
Read a float property from the POF stream. |
float[] |
readFloatArray(int iProp)
Read a float[] property from the POF stream. |
int |
readInt(int iProp)
Read a int property from the POF stream. |
int[] |
readIntArray(int iProp)
Read a int[] property from the POF stream. |
long |
readLong(int iProp)
Read a long property from the POF stream. |
long[] |
readLongArray(int iProp)
Read a long[] property from the POF stream. |
LongArray |
readLongArray(int iProp,
LongArray array)
Read a LongArray of object values. |
Map |
readMap(int iProp,
Map map)
Read a Map of key/value pairs from the POF stream. |
Object |
readObject(int iProp)
Read a property of any type, including a user type, from the POF stream. |
Object[] |
readObjectArray(int iProp,
Object[] ao)
Read an array of object values. |
RawDate |
readRawDate(int iProp)
Read a RawDate from the POF stream. |
RawDateTime |
readRawDateTime(int iProp)
Read a RawDateTime from the POF stream. |
RawDayTimeInterval |
readRawDayTimeInterval(int iProp)
Read a RawDayTimeInterval from the POF stream. |
RawQuad |
readRawQuad(int iProp)
Read a RawQuad from the POF stream. |
RawTime |
readRawTime(int iProp)
Read a RawTime from the POF stream. |
RawTimeInterval |
readRawTimeInterval(int iProp)
Read a RawTimeInterval from the POF stream. |
RawYearMonthInterval |
readRawYearMonthInterval(int iProp)
Read a RawYearMonthInterval from the POF stream. |
Binary |
readRemainder()
Read all remaining indexed properties of the current user type from the POF stream. |
short |
readShort(int iProp)
Read a short property from the POF stream. |
short[] |
readShortArray(int iProp)
Read a short[] property from the POF stream. |
String |
readString(int iProp)
Read a String from the POF stream. |
protected void |
registerIdentity(int nId,
Object oValue)
Register the passed value with the passed identity. |
void |
setPofContext(PofContext ctx)
Configure the PofContext object used by this PofReader to deserialize user types from a POF stream. |
Field Detail |
---|
protected ReadBuffer.BufferInput m_in
protected PofContext m_ctx
protected SparseArray m_arrayRefs
Constructor Detail |
---|
public PofBufferReader(ReadBuffer.BufferInput in, PofContext ctx)
in
- a BufferInput objectctx
- the PofContextprotected PofBufferReader()
Method Detail |
---|
public boolean readBoolean(int iProp) throws IOException
readBoolean
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic byte readByte(int iProp) throws IOException
readByte
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic char readChar(int iProp) throws IOException
readChar
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic short readShort(int iProp) throws IOException
readShort
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic int readInt(int iProp) throws IOException
readInt
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic long readLong(int iProp) throws IOException
readLong
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic float readFloat(int iProp) throws IOException
readFloat
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic double readDouble(int iProp) throws IOException
readDouble
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic boolean[] readBooleanArray(int iProp) throws IOException
readBooleanArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic byte[] readByteArray(int iProp) throws IOException
readByteArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic char[] readCharArray(int iProp) throws IOException
readCharArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic short[] readShortArray(int iProp) throws IOException
readShortArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic int[] readIntArray(int iProp) throws IOException
readIntArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic long[] readLongArray(int iProp) throws IOException
readLongArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic float[] readFloatArray(int iProp) throws IOException
readFloatArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic double[] readDoubleArray(int iProp) throws IOException
readDoubleArray
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic BigInteger readBigInteger(int iProp) throws IOException
readBigInteger
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawQuad readRawQuad(int iProp) throws IOException
readRawQuad
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic BigDecimal readBigDecimal(int iProp) throws IOException
readBigDecimal
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic Binary readBinary(int iProp) throws IOException
readBinary
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic String readString(int iProp) throws IOException
readString
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic Date readDate(int iProp) throws IOException
readDate
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawDate readRawDate(int iProp) throws IOException
RawDate
class
contains the raw date information that was carried in the POF stream.
readRawDate
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawTime readRawTime(int iProp) throws IOException
RawTime
class
contains the raw time information that was carried in the POF stream,
including raw timezone information.
readRawTime
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawDateTime readRawDateTime(int iProp) throws IOException
RawDateTime
class contains the raw date and time information that was
carried in the POF stream, including raw timezone information.
readRawDateTime
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawYearMonthInterval readRawYearMonthInterval(int iProp) throws IOException
RawYearMonthInterval
class contains the raw year-month interval
information that was carried in the POF stream.
readRawYearMonthInterval
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawTimeInterval readRawTimeInterval(int iProp) throws IOException
RawTimeInterval
class contains the raw time interval information that
was carried in the POF stream.
readRawTimeInterval
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic RawDayTimeInterval readRawDayTimeInterval(int iProp) throws IOException
RawDayTimeInterval
class contains the raw year-month interval
information that was carried in the POF stream.
readRawDayTimeInterval
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic Object[] readObjectArray(int iProp, Object[] ao) throws IOException
readObjectArray
in interface PofReader
iProp
- the property index to readao
- the optional array to use to store the values, or to use
as a typed template for creating an array to store the
values, following the documentation for
Collection.toArray()
IOException
- if an I/O error occurspublic LongArray readLongArray(int iProp, LongArray array) throws IOException
readLongArray
in interface PofReader
iProp
- the property index to readarray
- the optional LongArray object to use to store the values
IOException
- if an I/O error occurspublic Collection readCollection(int iProp, Collection coll) throws IOException
readCollection
in interface PofReader
iProp
- the property index to readcoll
- the optional Collection to use to store the values
IOException
- if an I/O error occurspublic Map readMap(int iProp, Map map) throws IOException
readMap
in interface PofReader
iProp
- the property index to readmap
- the optional Map to initialize
IOException
- if an I/O error occurspublic PofContext getPofContext()
getPofContext
in interface PofReader
public void setPofContext(PofContext ctx)
PofContext ctxOrig = reader.getPofContext(); try { // switch to another PofContext PofContext ctxNew = ...; reader.setContext(ctxNew); // read POF data using the reader } finally { // restore the original PofContext reader.setPofContext(ctxOrig); }
setPofContext
in interface PofReader
ctx
- the new PofContext; must not be nullpublic Object readObject(int iProp) throws IOException
readObject
in interface PofReader
iProp
- the property index to read
IOException
- if an I/O error occurspublic int getUserTypeId()
getUserTypeId
in interface PofReader
public int getVersionId()
getVersionId
in interface PofReader
public Binary readRemainder() throws IOException
readRemainder
in interface PofReader
IOException
- if an I/O error occursprotected boolean advanceTo(int iProp) throws IOException
iProp
- the index of the property to advance to
IllegalStateException
- if the POF stream has already advanced
past the desired property
IOException
- if an I/O error occursprotected void complete(int iProp) throws IOException
iProp
- the property index
IOException
- if an I/O error occursprotected PofBufferReader getParentParser()
protected SparseArray ensureReferenceRegistry()
protected void registerIdentity(int nId, Object oValue) throws IOException
nId
- oValue
-
IOException
- if the specified identity is already registeredprotected Object lookupIdentity(int nId) throws IOException
nId
- the identity
IOException
- if the requested identity is not registeredprotected Object readAsObject(int nType) throws IOException
nType
- the type identifier of the value
IOException
- if an I/O error occursprotected Object[] readAsObjectArray(int nType, Object[] ao) throws IOException
nType
- the type identifier of the valueao
- the optional array to use to store the values, or to use
as a typed template for creating an array to store the
values, following the documentation for
Collection.toArray()
IOException
- if an I/O error occurs
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |