- java.lang.Object
-
- com.pervasive.datarush.encoding.binary.AbstractTokenDecoder
-
- All Implemented Interfaces:
TokenDecoder
- Direct Known Subclasses:
SparseRecordDecoder
public abstract class AbstractTokenDecoder extends Object implements TokenDecoder
Base class for TokenEncoders
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTokenDecoder()
Initializes a new decoder.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
decodeField(BinaryReader source, int fieldIndex, boolean skip)
This implementation delegates toTokenDecoder.decode(BinaryReader, boolean)
.protected abstract void
doTargetUpdated(TokenSettable target)
Sets the target buffer for decoding.protected TokenSettable
getTarget()
Returns the current target held by this decoder.void
setTarget(TokenSettable target)
This implementation sets the target variable and invokes the methoddoTargetUpdated(TokenSettable)
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.pervasive.datarush.encoding.TokenDecoder
decode
-
-
-
-
Method Detail
-
setTarget
public final void setTarget(TokenSettable target)
This implementation sets the target variable and invokes the methoddoTargetUpdated(TokenSettable)
.- Specified by:
setTarget
in interfaceTokenDecoder
- Parameters:
target
- the target buffer into which to decode.
-
decodeField
public void decodeField(BinaryReader source, int fieldIndex, boolean skip)
This implementation delegates toTokenDecoder.decode(BinaryReader, boolean)
. Implementations that require field-specific handling should override this method instead.- Specified by:
decodeField
in interfaceTokenDecoder
- Parameters:
source
- the reader containing the encodingfieldIndex
- the index of the field being decodedskip
- a value of true means decode the bytes but don't set on target
-
getTarget
protected final TokenSettable getTarget()
Returns the current target held by this decoder.- Returns:
- the current target held by this decoder.
-
doTargetUpdated
protected abstract void doTargetUpdated(TokenSettable target)
Sets the target buffer for decoding. Invoked when the target is initially set or updated.- Parameters:
target
- the buffer into which decoded valued are written
-
-