public abstract class AbstractScalarEncoder extends AbstractTokenEncoder
Modifier | Constructor and Description |
---|---|
protected |
AbstractScalarEncoder()
Initializes a new encoder.
|
Modifier and Type | Method and Description |
---|---|
void |
encode(BinaryBuilder buffer)
This implementation invokes
encodeScalar(BinaryBuilder)
in the event that the source is non-null. |
void |
encodeField(BinaryBuilder buffer,
int index)
This implementation delegates to
TokenEncoder.encode(BinaryBuilder) . |
protected abstract void |
encodeScalar(BinaryBuilder buffer)
Subclasses must override this method to handle the encoding
of the value.
|
doSourceUpdated, getSource, setSource
protected AbstractScalarEncoder()
public final void encode(BinaryBuilder buffer)
encodeScalar(BinaryBuilder)
in the event that the source is non-null.buffer
- the buffer to which to append the encodingpublic void encodeField(BinaryBuilder buffer, int index)
AbstractTokenEncoder
TokenEncoder.encode(BinaryBuilder)
.
Implementations that require field-specific handling should override
this method instead.encodeField
in interface TokenEncoder
encodeField
in class AbstractTokenEncoder
buffer
- the buffer to which to append the encodingindex
- the index of the field to encodeprotected abstract void encodeScalar(BinaryBuilder buffer)
buffer
- The buffer to encode into.Copyright © 2020 Actian Corporation. All rights reserved.