java.lang.Object
com.pervasive.datarush.encoding.binary.AbstractTokenEncoder
- All Implemented Interfaces:
TokenEncoder
- Direct Known Subclasses:
AbstractScalarEncoder
Base class for TokenEncoders.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoSourceUpdated(TokenValued source) Sets the source buffer for encoding.voidencodeField(BinaryBuilder buffer, int index) This implementation delegates toTokenEncoder.encode(BinaryBuilder).protected final TokenValuedReturns the current source held by this encoder.final 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, waitMethods inherited from interface com.pervasive.datarush.encoding.TokenEncoder
encode
-
Constructor Details
-
AbstractTokenEncoder
protected AbstractTokenEncoder()Initializes a new encoder.
-
-
Method Details
-
setSource
This implementation sets the source variable and invokes the methoddoSourceUpdated(TokenValued).- Specified by:
setSourcein interfaceTokenEncoder- Parameters:
source- the value container to encode
-
encodeField
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
Returns the current source held by this encoder.- Returns:
- the current source held by this encoder.
-
doSourceUpdated
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
-