- java.lang.Object
-
- com.pervasive.datarush.encoding.binary.TokenEncodings
-
public final class TokenEncodings extends Object
A factory for obtaining standard encoders/decoders for token values.- See Also:
TokenEncoder
,TokenDecoder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenDecoder
allocateDecoder(TokenType type, TokenOrder... ordering)
Creates a default decoder appropriate for the given type.TokenEncoder
allocateEncoder(TokenType type, TokenOrder... ordering)
Creates a default encoder appropriate for the given type.TokenDecoder
allocateRecordDecoder(RecordTokenType type, ComparableTokenDecoder[] comparableDecoders, TokenDecoder[] fieldDecoders)
Creates a record decoder from a list of field decoders for the fields in the record.TokenEncoder
allocateRecordEncoder(RecordTokenType type, ComparableTokenEncoder[] comparableEncoders, TokenEncoder[] fieldEncoders)
Creates a record encoder from a list of field encoders for the fields in the record.static TokenEncodings
getDefaultInstance()
Returns the default instance of TokenEncodings, configured according toservice lookup
for the serviceEncoderFactory
.TokenEncodings
newInstance(EncoderFactory factory)
Returns a new instance of TokenEncodings, configured with the encoder factories of this instance, plus the given factory.
-
-
-
Method Detail
-
getDefaultInstance
public static TokenEncodings getDefaultInstance()
Returns the default instance of TokenEncodings, configured according toservice lookup
for the serviceEncoderFactory
.- Returns:
- the default instance of TokenEncodings
-
newInstance
public TokenEncodings newInstance(EncoderFactory factory)
Returns a new instance of TokenEncodings, configured with the encoder factories of this instance, plus the given factory. The additional factory will be added at the beginning of the list so as to take precedence over all other factories.- Parameters:
factory
- The additional factory.- Returns:
- a new instance of TokenEncodings, configured with the given factory.
-
allocateDecoder
public TokenDecoder allocateDecoder(TokenType type, TokenOrder... ordering)
Creates a default decoder appropriate for the given type. The resulting decoder can decode encodings made by the default encoder for the type.- Parameters:
type
- the type of the data to be decodedordering
- ordering information- Returns:
- a decoder for the type
-
allocateEncoder
public TokenEncoder allocateEncoder(TokenType type, TokenOrder... ordering)
Creates a default encoder appropriate for the given type.- Parameters:
type
- the type of the data to be decodedordering
- ordering information- Returns:
- a default encoder for the type
-
allocateRecordDecoder
public TokenDecoder allocateRecordDecoder(RecordTokenType type, ComparableTokenDecoder[] comparableDecoders, TokenDecoder[] fieldDecoders)
Creates a record decoder from a list of field decoders for the fields in the record.- Parameters:
type
- the record type to decodecomparableDecoders
- array of field decoders for ordering key fields in the record.fieldDecoders
- array of field decoders for the non-ordering key fields in the record.- Returns:
- the record decoder
-
allocateRecordEncoder
public TokenEncoder allocateRecordEncoder(RecordTokenType type, ComparableTokenEncoder[] comparableEncoders, TokenEncoder[] fieldEncoders)
Creates a record encoder from a list of field encoders for the fields in the record.- Parameters:
type
- the record type to encodecomparableEncoders
- array of field encoders for ordering key fields in the record.fieldEncoders
- array of field encoders for the non-ordering key fields in the record.- Returns:
- the record encoder
-
-