- java.lang.Object
-
- com.pervasive.datarush.encoding.binary.AbstractTokenEncoder
-
- All Implemented Interfaces:
TokenEncoder
- Direct Known Subclasses:
AbstractScalarEncoder
public abstract class AbstractTokenEncoder extends Object implements TokenEncoder
Base class for TokenEncoders.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTokenEncoder()
Initializes a new encoder.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doSourceUpdated(TokenValued source)
Sets the source buffer for encoding.void
encodeField(BinaryBuilder buffer, int index)
This implementation delegates toTokenEncoder.encode(BinaryBuilder)
.protected TokenValued
getSource()
Returns the current source held by this encoder.void
setSource(TokenValued source)
This implementation sets the source variable and invokes the methoddoSourceUpdated(TokenValued)
.-
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.TokenEncoder
encode
-
-
-
-
Method Detail
-
setSource
public final void setSource(TokenValued source)
This implementation sets the source variable and invokes the methoddoSourceUpdated(TokenValued)
.- Specified by:
setSource
in interfaceTokenEncoder
- Parameters:
source
- the value container to encode
-
encodeField
public void encodeField(BinaryBuilder buffer, int index)
This implementation delegates toTokenEncoder.encode(BinaryBuilder)
. Implementations that require field-specific handling should override this method instead.- Specified by:
encodeField
in interfaceTokenEncoder
- Parameters:
buffer
- the buffer to which to append the encodingindex
- the index of the field to encode
-
getSource
protected final TokenValued getSource()
Returns the current source held by this encoder.- Returns:
- the current source held by this encoder.
-
doSourceUpdated
protected abstract void doSourceUpdated(TokenValued source)
Sets the source buffer for encoding. Invoked when the source is initially set or updated.- Parameters:
source
- the buffer from which values to encode are read
-
-