java.lang.Object
com.pervasive.datarush.encoding.binary.AbstractTokenEncoder
com.pervasive.datarush.encoding.binary.AbstractScalarEncoder
- All Implemented Interfaces:
TokenEncoder
Base class for scalar encoders. Handles uniform encoding of null
values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidencode(BinaryBuilder buffer) This implementation invokesencodeScalar(BinaryBuilder)in the event that the source is non-null.voidencodeField(BinaryBuilder buffer, int index) This implementation delegates toTokenEncoder.encode(BinaryBuilder).protected abstract voidencodeScalar(BinaryBuilder buffer) Subclasses must override this method to handle the encoding of the value.Methods inherited from class com.pervasive.datarush.encoding.binary.AbstractTokenEncoder
doSourceUpdated, getSource, setSource
-
Constructor Details
-
AbstractScalarEncoder
protected AbstractScalarEncoder()Initializes a new encoder.
-
-
Method Details
-
encode
This implementation invokesencodeScalar(BinaryBuilder)in the event that the source is non-null.- Parameters:
buffer- the buffer to which to append the encoding
-
encodeField
Description copied from class:AbstractTokenEncoderThis implementation delegates toTokenEncoder.encode(BinaryBuilder). Implementations that require field-specific handling should override this method instead.- Specified by:
encodeFieldin interfaceTokenEncoder- Overrides:
encodeFieldin classAbstractTokenEncoder- Parameters:
buffer- the buffer to which to append the encodingindex- the index of the field to encode
-
encodeScalar
Subclasses must override this method to handle the encoding of the value. This method is guaranteed to only be invoked if non-null.- Parameters:
buffer- The buffer to encode into.
-