- 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 protectedAbstractTokenEncoder()Initializes a new encoder.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoSourceUpdated(TokenValued source)Sets the source buffer for encoding.voidencodeField(BinaryBuilder buffer, int index)This implementation delegates toTokenEncoder.encode(BinaryBuilder).protected TokenValuedgetSource()Returns the current source held by this encoder.voidsetSource(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:
setSourcein 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:
encodeFieldin 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
-
-