org.openfast.template.type.codec
Class TypeCodec

java.lang.Object
  extended by org.openfast.template.type.codec.TypeCodec
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BitVectorType, DateInteger, DateString, EpochTimestamp, IntegerCodec, MillisecondsSinceMidnight, NotStopBitEncodedTypeCodec, NullableStringDelta, StringDelta, TimeInteger, TimestampInteger

public abstract class TypeCodec
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static TypeCodec ASCII
           
static TypeCodec BIT_VECTOR
           
static TypeCodec BYTE_VECTOR
           
static TypeCodec DATE_INTEGER
           
static TypeCodec DATE_STRING
           
static TypeCodec EPOCH_TIMESTAMP
           
static TypeCodec INTEGER
           
static TypeCodec NULLABLE_ASCII
           
static TypeCodec NULLABLE_BYTE_VECTOR_TYPE
           
static TypeCodec NULLABLE_INTEGER
           
static TypeCodec NULLABLE_SF_SCALED_NUMBER
           
static TypeCodec NULLABLE_STRING_DELTA
           
static TypeCodec NULLABLE_UNICODE
           
static TypeCodec NULLABLE_UNSIGNED_INTEGER
           
static TypeCodec SF_SCALED_NUMBER
           
protected static byte STOP_BIT
           
static TypeCodec STRING_DELTA
           
static TypeCodec TIME_IN_MS
           
static TypeCodec TIME_INTEGER
           
static TypeCodec TIME_STRING
           
static TypeCodec TIMESTAMP_INTEGER
           
static TypeCodec TIMESTAMP_STRING
           
static TypeCodec UINT
           
static TypeCodec UNICODE
           
 
Constructor Summary
TypeCodec()
           
 
Method Summary
abstract  ScalarValue decode(java.io.InputStream in)
           
 byte[] encode(ScalarValue value)
          Template Method to encode the passed object, the actual encoding is done in the encodeValue() method overridden in sub-classes.
abstract  byte[] encodeValue(ScalarValue value)
           
 boolean isNullable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STOP_BIT

protected static final byte STOP_BIT
See Also:
Constant Field Values

UINT

public static final TypeCodec UINT

INTEGER

public static final TypeCodec INTEGER

ASCII

public static final TypeCodec ASCII

UNICODE

public static final TypeCodec UNICODE

BIT_VECTOR

public static final TypeCodec BIT_VECTOR

BYTE_VECTOR

public static final TypeCodec BYTE_VECTOR

SF_SCALED_NUMBER

public static final TypeCodec SF_SCALED_NUMBER

STRING_DELTA

public static final TypeCodec STRING_DELTA

NULLABLE_UNSIGNED_INTEGER

public static final TypeCodec NULLABLE_UNSIGNED_INTEGER

NULLABLE_INTEGER

public static final TypeCodec NULLABLE_INTEGER

NULLABLE_ASCII

public static final TypeCodec NULLABLE_ASCII

NULLABLE_UNICODE

public static final TypeCodec NULLABLE_UNICODE

NULLABLE_BYTE_VECTOR_TYPE

public static final TypeCodec NULLABLE_BYTE_VECTOR_TYPE

NULLABLE_SF_SCALED_NUMBER

public static final TypeCodec NULLABLE_SF_SCALED_NUMBER

NULLABLE_STRING_DELTA

public static final TypeCodec NULLABLE_STRING_DELTA

DATE_STRING

public static final TypeCodec DATE_STRING

DATE_INTEGER

public static final TypeCodec DATE_INTEGER

TIMESTAMP_STRING

public static final TypeCodec TIMESTAMP_STRING

TIMESTAMP_INTEGER

public static final TypeCodec TIMESTAMP_INTEGER

EPOCH_TIMESTAMP

public static final TypeCodec EPOCH_TIMESTAMP

TIME_STRING

public static final TypeCodec TIME_STRING

TIME_INTEGER

public static final TypeCodec TIME_INTEGER

TIME_IN_MS

public static final TypeCodec TIME_IN_MS
Constructor Detail

TypeCodec

public TypeCodec()
Method Detail

encodeValue

public abstract byte[] encodeValue(ScalarValue value)

decode

public abstract ScalarValue decode(java.io.InputStream in)

encode

public byte[] encode(ScalarValue value)
Template Method to encode the passed object, the actual encoding is done in the encodeValue() method overridden in sub-classes.

Note: The final SBIT is set in this method, not in encodeValue().

Parameters:
value - The ScalarValue object to be encoded
Returns:
Returns an encoded byte array with an added stop bit at the end

isNullable

public boolean isNullable()
Returns:
Returns false


Copyright © 2006-2008 The LaSalle Technology Group, LLC. All Rights Reserved.