Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.io.pof
Class LoggingPofHandler

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.io.pof.PofHelper
          extended by com.tangosol.io.pof.LoggingPofHandler

All Implemented Interfaces:
PofConstants, PofHandler

public class LoggingPofHandler
extends PofHelper
implements PofHandler

An implementation of PofHandler that logs all of the stream contents for debugging / testing purposes.

Since:
Coherence 3.2
Author:
cp 2006.07.11

Nested Class Summary

 

Nested classes/interfaces inherited from class com.tangosol.io.pof.PofHelper
PofHelper.ReadableEntrySetMap, PofHelper.WriteableEntrySetMap

 

Field Summary

 

Fields inherited from class com.tangosol.io.pof.PofHelper
BIGDECIMAL_ZERO, BIGINTEGER_MAX_LONG, BIGINTEGER_MIN_LONG, 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

 

Fields inherited from interface com.tangosol.io.pof.PofConstants
J_BIG_DECIMAL, J_BIG_INTEGER, J_BINARY, J_BOOLEAN, J_BOOLEAN_ARRAY, J_BYTE, J_BYTE_ARRAY, J_CHAR_ARRAY, J_CHARACTER, J_COLLECTION, J_DATE, J_DATETIME, J_DOUBLE, J_DOUBLE_ARRAY, J_FLOAT, J_FLOAT_ARRAY, J_INT_ARRAY, J_INTEGER, J_LONG, J_LONG_ARRAY, J_MAP, J_NULL, J_OBJECT_ARRAY, J_QUAD, J_RAW_DATE, J_RAW_DATETIME, J_RAW_DAY_TIME_INTERVAL, J_RAW_TIME, J_RAW_TIME_INTERVAL, J_RAW_YEAR_MONTH_INTERVAL, J_SHORT, J_SHORT_ARRAY, J_SPARSE_ARRAY, J_STRING, J_TIME, J_TIMESTAMP, J_USER_TYPE, MAX_DECIMAL128_SCALE, MAX_DECIMAL128_UNSCALED, MAX_DECIMAL32_SCALE, MAX_DECIMAL32_UNSCALED, MAX_DECIMAL64_SCALE, MAX_DECIMAL64_UNSCALED, MIN_DECIMAL128_SCALE, MIN_DECIMAL32_SCALE, MIN_DECIMAL64_SCALE, T_ARRAY, T_BOOLEAN, T_CHAR, T_CHAR_STRING, T_COLLECTION, T_DATE, T_DATETIME, T_DAY_TIME_INTERVAL, T_DECIMAL128, T_DECIMAL32, T_DECIMAL64, T_FLOAT128, T_FLOAT32, T_FLOAT64, T_IDENTITY, T_INT128, T_INT16, T_INT32, T_INT64, T_MAP, T_OCTET, T_OCTET_STRING, T_REFERENCE, T_SPARSE_ARRAY, T_TIME, T_TIME_INTERVAL, T_UNIFORM_ARRAY, T_UNIFORM_COLLECTION, T_UNIFORM_KEYS_MAP, T_UNIFORM_MAP, T_UNIFORM_SPARSE_ARRAY, T_UNKNOWN, T_YEAR_MONTH_INTERVAL, V_BOOLEAN_FALSE, V_BOOLEAN_TRUE, V_COLLECTION_EMPTY, V_FP_NAN, V_FP_NEG_INFINITY, V_FP_POS_INFINITY, V_INT_0, V_INT_1, V_INT_10, V_INT_11, V_INT_12, V_INT_13, V_INT_14, V_INT_15, V_INT_16, V_INT_17, V_INT_18, V_INT_19, V_INT_2, V_INT_20, V_INT_21, V_INT_22, V_INT_3, V_INT_4, V_INT_5, V_INT_6, V_INT_7, V_INT_8, V_INT_9, V_INT_NEG_1, V_REFERENCE_NULL, V_STRING_ZERO_LENGTH

 

Constructor Summary
LoggingPofHandler()
          Default constructor: Construct a Logging POF Handler that sends all logging output to standard output.
LoggingPofHandler(java.io.PrintWriter writer)
          Construct a Logging POF Handler that sends all logging output to the specified PrintWriter.

 

Method Summary
protected  void adjustDepth(int cDelta)
          Adjust the complex data structure depth.
protected  void begin(int iPos, java.lang.String s)
          Begin a complex data structure, such as a user type or a collection.
 void beginArray(int iPos, int cElements)
          Report that an array of values has been encountered in the POF stream.
 void beginCollection(int iPos, int cElements)
          Report that a collection of values has been encountered in the POF stream.
 void beginMap(int iPos, int cElements)
          Report that a map of key/value pairs has been encountered in the POF stream.
 void beginSparseArray(int iPos, int cElements)
          Report that a sparse array of values has been encountered in the POF stream.
 void beginUniformArray(int iPos, int cElements, int nType)
          Report that a uniform array of values has been encountered in the POF stream.
 void beginUniformCollection(int iPos, int cElements, int nType)
          Report that a uniform collection of values has been encountered in the POF stream.
 void beginUniformKeysMap(int iPos, int cElements, int nTypeKeys)
          Report that a map of key/value pairs (with the keys being of a uniform type) has been encountered in the POF stream.
 void beginUniformMap(int iPos, int cElements, int nTypeKeys, int nTypeValues)
          Report that a map of key/value pairs (with the keys being of a uniform type and the values being of a uniform type) has been encountered in the POF stream.
 void beginUniformSparseArray(int iPos, int cElements, int nType)
          Report that a uniform sparse array of values has been encountered in the POF stream.
 void beginUserType(int iPos, int nUserTypeId, int nVersionId)
          Report that a value of a "user type" has been encountered in the POF stream.
protected  void end()
          End a complex data structure.
 void endComplexValue()
          Signifies the termination of the current complex value.
protected  int getDepth()
          Determine the current nested data structure depth within the POF stream.
protected  java.lang.String getIndent()
          Determine the current textual indent for logging, which is based on the nested data structure depth within the POF stream.
 java.io.PrintWriter getPrintWriter()
          Obtain the PrintWriter that is used by this LoggingPofHandler.
 void onBoolean(int iPos, boolean f)
          Report that a boolean value has been encountered in the POF stream.
 void onChar(int iPos, char ch)
          Report that a character value has been encountered in the POF stream.
 void onCharString(int iPos, java.lang.String s)
          Report that a character string value has been encountered in the POF stream.
 void onDate(int iPos, int nYear, int nMonth, int nDay)
          Report that a date value has been encountered in the POF stream.
 void onDateTime(int iPos, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, int nNano, boolean fUTC)
          Report that a date-time value has been encountered in the POF stream.
 void onDateTime(int iPos, int nYear, int nMonth, int nDay, int nHour, int nMinute, int nSecond, int nNano, int nHourOffset, int nMinuteOffset)
          Report that a date-time value (with a timezone offset) has been encountered in the POF stream.
 void onDayTimeInterval(int iPos, int cDays, int cHours, int cMinutes, int cSeconds, int cNanos)
          Report that a day-time interval value has been encountered in the POF stream.
 void onDecimal128(int iPos, java.math.BigDecimal dec)
          Report that a quad-precision decimal value (a base-10 floating point) has been encountered in the POF stream.
 void onDecimal32(int iPos, java.math.BigDecimal dec)
          Report that a single-precision decimal value (a base-10 floating point) has been encountered in the POF stream.
 void onDecimal64(int iPos, java.math.BigDecimal dec)
          Report that a double-precision decimal value (a base-10 floating point) has been encountered in the POF stream.
 void onFloat128(int iPos, RawQuad qfl)
          Report that a base-2 quad-precision floating point value has been encountered in the POF stream.
 void onFloat32(int iPos, float fl)
          Report that a base-2 single-precision floating point value has been encountered in the POF stream.
 void onFloat64(int iPos, double dfl)
          Report that a base-2 double-precision floating point value has been encountered in the POF stream.
 void onIdentityReference(int iPos, int nId)
          Specifies that a reference to a previously-identified value has been encountered in the POF stream.
 void onInt128(int iPos, java.math.BigInteger n)
          Report that a 128-bit integer value has been encountered in the POF stream.
 void onInt16(int iPos, short n)
          Report that a short integer value has been encountered in the POF stream.
 void onInt32(int iPos, int n)
          Report that an integer value has been encountered in the POF stream.
 void onInt64(int iPos, long n)
          Report that a long integer value has been encountered in the POF stream.
 void onNullReference(int iPos)
          Specifies that a null value has been encountered in the POF stream.
 void onOctet(int iPos, int b)
          Report that an octet value (a byte) has been encountered in the POF stream.
 void onOctetString(int iPos, Binary bin)
          Report that a octet string value has been encountered in the POF stream.
 void onTime(int iPos, int nHour, int nMinute, int nSecond, int nNano, boolean fUTC)
          Report that a time value has been encountered in the POF stream.
 void onTime(int iPos, int nHour, int nMinute, int nSecond, int nNano, int nHourOffset, int nMinuteOffset)
          Report that a time value (with a timezone offset) has been encountered in the POF stream.
 void onTimeInterval(int iPos, int cHours, int cMinutes, int cSeconds, int cNanos)
          Report that a time interval value has been encountered in the POF stream.
 void onYearMonthInterval(int iPos, int cYears, int cMonths)
          Report that a year-month interval value has been encountered in the POF stream.
protected  void print(java.lang.String s)
          Print the passed String.
 void registerIdentity(int nId)
          This method is invoked when an identity is encountered in the POF stream.
 void setPrintWriter(java.io.PrintWriter writer)
          Specify a PrintWriter to be used by this LoggingPofHandler.
protected  void show(int iPos, java.lang.String s)
          Log information related to the POF stream.

 

Methods inherited from class com.tangosol.io.pof.PofHelper
calcDecimalSize, checkDate, checkDayTimeInterval, checkDecimalRange, checkElementCount, checkReferenceRange, checkTime, checkTimeInterval, checkTimeZone, checkType, checkYearMonthInterval, convertNumber, convertToDate, decodeTinyInt, encodeTinyInt, formatDate, formatTime, formatTime, getJavaTypeId, getPofTypeId, isIntrinsicPofType, readAsBigDecimal, readAsBigInteger, readAsChar, readAsDouble, readAsFloat, readAsInt, readAsLong, readAsQuad, readBigDecimal, readBigInteger, readChar, readQuad, readRawDate, readRawTime, resizeArray, skipPackedInts, skipUniformValue, skipValue, writeBigDecimal, writeBigInteger, writeDate, writeTime

 

Constructor Detail

LoggingPofHandler

public LoggingPofHandler()
Default constructor: Construct a Logging POF Handler that sends all logging output to standard output.

LoggingPofHandler

public LoggingPofHandler(java.io.PrintWriter writer)
Construct a Logging POF Handler that sends all logging output to the specified PrintWriter.

Method Detail

registerIdentity

public void registerIdentity(int nId)
This method is invoked when an identity is encountered in the POF stream. The identity is used to uniquely identify the next value in the POF stream, and can be later referenced by the PofHandler.onIdentityReference(int, int) method.
Specified by:
registerIdentity in interface PofHandler
Parameters:
nId - if (nId >= 0), then this is the identity encountered in the POF stream, otherwise it is an indicator that the following value could have been assigned an identifier but was not (i.e. that the subsequent value is of a referenceable data type)

onNullReference

public void onNullReference(int iPos)
Specifies that a null value has been encountered in the POF stream.
Specified by:
onNullReference in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise

onIdentityReference

public void onIdentityReference(int iPos,
                                int nId)
Specifies that a reference to a previously-identified value has been encountered in the POF stream.
Specified by:
onIdentityReference in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nId - the identity of the previously encountered value, as was specified in a previous call to PofHandler.registerIdentity(int)

onInt16

public void onInt16(int iPos,
                    short n)
Report that a short integer value has been encountered in the POF stream.
Specified by:
onInt16 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
n - the integer value as a short

onInt32

public void onInt32(int iPos,
                    int n)
Report that an integer value has been encountered in the POF stream.
Specified by:
onInt32 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
n - the integer value as an int

onInt64

public void onInt64(int iPos,
                    long n)
Report that a long integer value has been encountered in the POF stream.
Specified by:
onInt64 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
n - the integer value as a long

onInt128

public void onInt128(int iPos,
                     java.math.BigInteger n)
Report that a 128-bit integer value has been encountered in the POF stream.
Specified by:
onInt128 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
n - the integer value as a BigInteger

onFloat32

public void onFloat32(int iPos,
                      float fl)
Report that a base-2 single-precision floating point value has been encountered in the POF stream.
Specified by:
onFloat32 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
fl - the floating point value as a float

onFloat64

public void onFloat64(int iPos,
                      double dfl)
Report that a base-2 double-precision floating point value has been encountered in the POF stream.
Specified by:
onFloat64 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
dfl - the floating point value as a double

onFloat128

public void onFloat128(int iPos,
                       RawQuad qfl)
Report that a base-2 quad-precision floating point value has been encountered in the POF stream.
Specified by:
onFloat128 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
qfl - the floating point value as a quad

onDecimal32

public void onDecimal32(int iPos,
                        java.math.BigDecimal dec)
Report that a single-precision decimal value (a base-10 floating point) has been encountered in the POF stream.
Specified by:
onDecimal32 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
dec - the decimal value as a BigDecimal

onDecimal64

public void onDecimal64(int iPos,
                        java.math.BigDecimal dec)
Report that a double-precision decimal value (a base-10 floating point) has been encountered in the POF stream.
Specified by:
onDecimal64 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
dec - the decimal value as a BigDecimal

onDecimal128

public void onDecimal128(int iPos,
                         java.math.BigDecimal dec)
Report that a quad-precision decimal value (a base-10 floating point) has been encountered in the POF stream.
Specified by:
onDecimal128 in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
dec - the decimal value as a BigDecimal

onBoolean

public void onBoolean(int iPos,
                      boolean f)
Report that a boolean value has been encountered in the POF stream.
Specified by:
onBoolean in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
f - the boolean value

onOctet

public void onOctet(int iPos,
                    int b)
Report that an octet value (a byte) has been encountered in the POF stream.
Specified by:
onOctet in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
b - the octet value as an int whose value is in the range 0 to 255 (0x00-0xFF) inclusive

onOctetString

public void onOctetString(int iPos,
                          Binary bin)
Report that a octet string value has been encountered in the POF stream.
Specified by:
onOctetString in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
bin - the octect string value as a Binary object

onChar

public void onChar(int iPos,
                   char ch)
Report that a character value has been encountered in the POF stream.
Specified by:
onChar in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
ch - the character value as a char

onCharString

public void onCharString(int iPos,
                         java.lang.String s)
Report that a character string value has been encountered in the POF stream.
Specified by:
onCharString in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
s - the character string value as a String object

onDate

public void onDate(int iPos,
                   int nYear,
                   int nMonth,
                   int nDay)
Report that a date value has been encountered in the POF stream.
Specified by:
onDate in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nYear - the year number as defined by ISO8601; note the difference with the Java Date class, whose year is relative to 1900
nMonth - the month number between 1 and 12 inclusive as defined by ISO8601; note the difference from the Java Date class, whose month value is 0-based (0-11)
nDay - the day number between 1 and 31 inclusive as defined by ISO8601

onYearMonthInterval

public void onYearMonthInterval(int iPos,
                                int cYears,
                                int cMonths)
Report that a year-month interval value has been encountered in the POF stream.
Specified by:
onYearMonthInterval in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cYears - the number of years in the year-month interval
cMonths - the number of months in the year-month interval

onTime

public void onTime(int iPos,
                   int nHour,
                   int nMinute,
                   int nSecond,
                   int nNano,
                   boolean fUTC)
Report that a time value has been encountered in the POF stream.
Specified by:
onTime in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nHour - the hour between 0 and 23 inclusive
nMinute - the minute value between 0 and 59 inclusive
nSecond - the second value between 0 and 59 inclusive (and theoretically 60 for a leap-second)
nNano - the nanosecond value between 0 and 999999999 inclusive
fUTC - true if the time value is UTC or false if the time value does not have an explicit time zone

onTime

public void onTime(int iPos,
                   int nHour,
                   int nMinute,
                   int nSecond,
                   int nNano,
                   int nHourOffset,
                   int nMinuteOffset)
Report that a time value (with a timezone offset) has been encountered in the POF stream.
Specified by:
onTime in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nHour - the hour between 0 and 23 inclusive
nMinute - the minute value between 0 and 59 inclusive
nSecond - the second value between 0 and 59 inclusive (and theoretically 60 for a leap-second)
nNano - the nanosecond value between 0 and 999999999 inclusive
nHourOffset - the timezone offset in hours from UTC, for example 0 for BST, -5 for EST and 1 for CET
nMinuteOffset - the timezone offset in minutes, for example 0 (in most cases) or 30
See Also:
worldtimezone.com

onTimeInterval

public void onTimeInterval(int iPos,
                           int cHours,
                           int cMinutes,
                           int cSeconds,
                           int cNanos)
Report that a time interval value has been encountered in the POF stream.
Specified by:
onTimeInterval in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cHours - the number of hours in the time interval
cMinutes - the number of minutes in the time interval, from 0 to 59 inclusive
cSeconds - the number of seconds in the time interval, from 0 to 59 inclusive
cNanos - the number of nanoseconds, from 0 to 999999999 inclusive

onDateTime

public void onDateTime(int iPos,
                       int nYear,
                       int nMonth,
                       int nDay,
                       int nHour,
                       int nMinute,
                       int nSecond,
                       int nNano,
                       boolean fUTC)
Report that a date-time value has been encountered in the POF stream.
Specified by:
onDateTime in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nYear - the year number as defined by ISO8601; note the difference with the Java Date class, whose year is relative to 1900
nMonth - the month number between 1 and 12 inclusive as defined by ISO8601; note the difference from the Java Date class, whose month value is 0-based (0-11)
nDay - the day number between 1 and 31 inclusive as defined by ISO8601
nHour - the hour between 0 and 23 inclusive
nMinute - the minute value between 0 and 59 inclusive
nSecond - the second value between 0 and 59 inclusive (and theoretically 60 for a leap-second)
nNano - the nanosecond value between 0 and 999999999 inclusive
fUTC - true if the time value is UTC or false if the time value does not have an explicit time zone

onDateTime

public void onDateTime(int iPos,
                       int nYear,
                       int nMonth,
                       int nDay,
                       int nHour,
                       int nMinute,
                       int nSecond,
                       int nNano,
                       int nHourOffset,
                       int nMinuteOffset)
Report that a date-time value (with a timezone offset) has been encountered in the POF stream.
Specified by:
onDateTime in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nYear - the year number as defined by ISO8601; note the difference with the Java Date class, whose year is relative to 1900
nMonth - the month number between 1 and 12 inclusive as defined by ISO8601; note the difference from the Java Date class, whose month value is 0-based (0-11)
nDay - the day number between 1 and 31 inclusive as defined by ISO8601
nHour - the hour between 0 and 23 inclusive
nMinute - the minute value between 0 and 59 inclusive
nSecond - the second value between 0 and 59 inclusive (and theoretically 60 for a leap-second)
nNano - the nanosecond value between 0 and 999999999 inclusive
nHourOffset - the timezone offset in hours from UTC, for example 0 for BST, -5 for EST and 1 for CET
nMinuteOffset - the timezone offset in minutes, for example 0 (in most cases) or 30

onDayTimeInterval

public void onDayTimeInterval(int iPos,
                              int cDays,
                              int cHours,
                              int cMinutes,
                              int cSeconds,
                              int cNanos)
Report that a day-time interval value has been encountered in the POF stream.
Specified by:
onDayTimeInterval in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cDays - the number of days in the day-time interval
cHours - the number of hours in the day-time interval, from 0 to 23 inclusive
cMinutes - the number of minutes in the day-time interval, from 0 to 59 inclusive
cSeconds - the number of seconds in the day-time interval, from 0 to 59 inclusive
cNanos - the number of nanoseconds in the day-time interval, from 0 to 999999999 inclusive

beginCollection

public void beginCollection(int iPos,
                            int cElements)
Report that a collection of values has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the collection, and the collection extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginCollection in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of values (elements) in the collection

beginUniformCollection

public void beginUniformCollection(int iPos,
                                   int cElements,
                                   int nType)
Report that a uniform collection of values has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the collection, and the collection extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginUniformCollection in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of values (elements) in the collection
nType - the type identifier for all of the values in the uniform collection

beginArray

public void beginArray(int iPos,
                       int cElements)
Report that an array of values has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the array, and the array extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginArray in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of values (elements) in the array

beginUniformArray

public void beginUniformArray(int iPos,
                              int cElements,
                              int nType)
Report that a uniform array of values has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the array, and the array extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginUniformArray in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of values (elements) in the array
nType - the type identifier for all of the values in the uniform array

beginSparseArray

public void beginSparseArray(int iPos,
                             int cElements)
Report that a sparse array of values has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for present element in the sparse array (up to cElements elements), and the array extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginSparseArray in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of elements in the array, which is greater than or equal to the number of values in the sparse POF stream; in other words, the number of values that will subsequently be reported will not exceed this number

beginUniformSparseArray

public void beginUniformSparseArray(int iPos,
                                    int cElements,
                                    int nType)
Report that a uniform sparse array of values has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for present element in the sparse array (up to cElements elements), and the array extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginUniformSparseArray in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of elements in the array, which is greater than or equal to the number of values in the sparse POF stream; in other words, the number of values that will subsequently be reported will not exceed this number
nType - the type identifier for all of the values in the uniform sparse array

beginMap

public void beginMap(int iPos,
                     int cElements)
Report that a map of key/value pairs has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the map, and the map extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginMap in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of key/value pairs (entries) in the map

beginUniformKeysMap

public void beginUniformKeysMap(int iPos,
                                int cElements,
                                int nTypeKeys)
Report that a map of key/value pairs (with the keys being of a uniform type) has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the map, and the map extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginUniformKeysMap in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of key/value pairs (entries) in the map
nTypeKeys - the type identifier for all of the keys in the uniform-keys map

beginUniformMap

public void beginUniformMap(int iPos,
                            int cElements,
                            int nTypeKeys,
                            int nTypeValues)
Report that a map of key/value pairs (with the keys being of a uniform type and the values being of a uniform type) has been encountered in the POF stream.

This method call will be followed by a separate call to an "on" or "begin" method for each of the cElements elements in the map, and the map extent will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginUniformMap in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
cElements - the exact number of key/value pairs (entries) in the map
nTypeKeys - the type identifier for all of the keys in the uniform map
nTypeValues - the type identifier for all of the values in the uniform map

beginUserType

public void beginUserType(int iPos,
                          int nUserTypeId,
                          int nVersionId)
Report that a value of a "user type" has been encountered in the POF stream. A user type is analogous to a "class", and a value of a user type is analogous to an "object".

This method call will be followed by a separate call to an "on" or "begin" method for each of the property values in the user type, and the user type will then be terminated by a call to PofHandler.endComplexValue().

Specified by:
beginUserType in interface PofHandler
Parameters:
iPos - context-sensitive position information: property index within a user type, array index within an array, element counter within a collection, entry counter within a map, -1 otherwise
nUserTypeId - the user type identifier, (nUserTypeId >= 0)
nVersionId - the version identifier for the user data type data in the POF stream, (nVersionId >= 0)

endComplexValue

public void endComplexValue()
Signifies the termination of the current complex value. Complex values are any of the collection, array, map and user types. For each call to one of the "begin" methods, there will be a corresponding call to this method, even if there were no contents in the complex value.
Specified by:
endComplexValue in interface PofHandler

getPrintWriter

public java.io.PrintWriter getPrintWriter()
Obtain the PrintWriter that is used by this LoggingPofHandler.
Returns:
the current PrintWriter, or null if none is used

setPrintWriter

public void setPrintWriter(java.io.PrintWriter writer)
Specify a PrintWriter to be used by this LoggingPofHandler.
Parameters:
writer - the PrintWriter to use, or null to use standard output

getDepth

protected int getDepth()
Determine the current nested data structure depth within the POF stream. Every time a data structure (e.g. a user type, a collection) is begun, the depth increases by one, and every time a data structure ends, the depth is decreased by one.
Returns:
the current complex data structure depth

getIndent

protected java.lang.String getIndent()
Determine the current textual indent for logging, which is based on the nested data structure depth within the POF stream.
Returns:
the current textual indent for logging

begin

protected void begin(int iPos,
                     java.lang.String s)
Begin a complex data structure, such as a user type or a collection.
Parameters:
iPos - the current position with a containing data structure
s - a description to log

end

protected void end()
End a complex data structure.

adjustDepth

protected void adjustDepth(int cDelta)
Adjust the complex data structure depth.
Parameters:
cDelta - either +1 or -1

show

protected void show(int iPos,
                    java.lang.String s)
Log information related to the POF stream.
Parameters:
iPos - the current position with a containing data structure
s - a description to log

print

protected void print(java.lang.String s)
Print the passed String.
Parameters:
s - the String to print

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


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