Class DefaultValueEncoder
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.schema.encoders.DefaultValueEncoder
-
- All Implemented Interfaces:
WritableValue,MixedWritableValue
- Direct Known Subclasses:
IgnoreWriter
public class DefaultValueEncoder extends java.lang.Object implements MixedWritableValue
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdefaultValueprotected DataTypetypeprotected WritableValuewritable
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultValueEncoder(WritableValue encoder, DataType type)DefaultValueEncoder(WritableValue encoder, java.lang.String defaultValue, DataType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MixedWritableValueclone(WritableValue out)UnboundEncodergetFieldEncoder(RecordClassDescriptor rcd)WritableValuenextWritableElement()Returns a transient (reused by interface implementation) WritableValue object for the next element of the array.voidsetArrayLength(int len)Set length of the array.voidwriteBinary(byte[] data, int offset, int length)voidwriteBoolean(boolean value)voidwriteBoolean(double value)voidwriteBoolean(float value)voidwriteBoolean(int value)voidwriteBoolean(long value)voidwriteChar(char value)voidwriteDefault()voidwriteDouble(double value)voidwriteEnum(java.lang.CharSequence value)voidwriteFloat(double value)voidwriteFloat(float value)voidwriteInt(double value)voidwriteInt(int value)voidwriteInt(long value)voidwriteLong(double value)voidwriteLong(float value)voidwriteLong(long value)voidwriteNull()voidwriteString(java.lang.CharSequence value)
-
-
-
Field Detail
-
writable
protected final WritableValue writable
-
defaultValue
protected final java.lang.String defaultValue
-
type
protected final DataType type
-
-
Constructor Detail
-
DefaultValueEncoder
protected DefaultValueEncoder(WritableValue encoder, DataType type)
-
DefaultValueEncoder
public DefaultValueEncoder(WritableValue encoder, java.lang.String defaultValue, DataType type)
-
-
Method Detail
-
writeDefault
public void writeDefault()
- Specified by:
writeDefaultin interfaceMixedWritableValue
-
writeNull
public void writeNull()
- Specified by:
writeNullin interfaceWritableValue
-
writeBoolean
public void writeBoolean(int value)
- Specified by:
writeBooleanin interfaceMixedWritableValue
-
writeBoolean
public void writeBoolean(long value)
- Specified by:
writeBooleanin interfaceMixedWritableValue
-
writeBoolean
public void writeBoolean(float value)
- Specified by:
writeBooleanin interfaceMixedWritableValue
-
writeBoolean
public void writeBoolean(double value)
- Specified by:
writeBooleanin interfaceMixedWritableValue
-
writeBoolean
public void writeBoolean(boolean value)
- Specified by:
writeBooleanin interfaceWritableValue
-
writeChar
public void writeChar(char value)
- Specified by:
writeCharin interfaceWritableValue
-
writeInt
public void writeInt(int value)
- Specified by:
writeIntin interfaceWritableValue
-
writeInt
public void writeInt(double value)
- Specified by:
writeIntin interfaceMixedWritableValue
-
writeInt
public void writeInt(long value)
- Specified by:
writeIntin interfaceMixedWritableValue
-
writeFloat
public void writeFloat(double value)
- Specified by:
writeFloatin interfaceMixedWritableValue
-
writeLong
public void writeLong(float value)
- Specified by:
writeLongin interfaceMixedWritableValue
-
writeLong
public void writeLong(double value)
- Specified by:
writeLongin interfaceMixedWritableValue
-
writeLong
public void writeLong(long value)
- Specified by:
writeLongin interfaceWritableValue
-
writeFloat
public void writeFloat(float value)
- Specified by:
writeFloatin interfaceWritableValue
-
writeDouble
public void writeDouble(double value)
- Specified by:
writeDoublein interfaceWritableValue
-
writeString
public void writeString(java.lang.CharSequence value)
- Specified by:
writeStringin interfaceWritableValue
-
setArrayLength
public void setArrayLength(int len)
Description copied from interface:WritableValueSet length of the array. It must be called prior to nextWritableElement- Specified by:
setArrayLengthin interfaceWritableValue- Parameters:
len- length of the array
-
nextWritableElement
public WritableValue nextWritableElement()
Description copied from interface:WritableValueReturns a transient (reused by interface implementation) WritableValue object for the next element of the array.
WritableValue.setArrayLength(int)method must be called before this method.
Client code must not cache the reference for further usage.
Usage sample:encoder.setArrayLength(10); for(int i=0; i<10; i++) { WritableValue v = encoder.nextWritableElement (i); v.setInt(i); }- Specified by:
nextWritableElementin interfaceWritableValue- Returns:
- reference to WritableValue object
-
getFieldEncoder
public UnboundEncoder getFieldEncoder(RecordClassDescriptor rcd)
- Specified by:
getFieldEncoderin interfaceWritableValue
-
writeBinary
public void writeBinary(byte[] data, int offset, int length)- Specified by:
writeBinaryin interfaceWritableValue
-
writeEnum
public void writeEnum(java.lang.CharSequence value)
- Specified by:
writeEnumin interfaceMixedWritableValue
-
clone
public MixedWritableValue clone(WritableValue out)
- Specified by:
clonein interfaceMixedWritableValue
-
-