Package deltix.qsrv.hf.pub.values
Class ValueBean
- java.lang.Object
-
- deltix.qsrv.hf.pub.values.ValueBean
-
- All Implemented Interfaces:
ReadableValue,WritableValue,java.io.Serializable
- Direct Known Subclasses:
BooleanValueBean,DoubleValueBean,FloatValueBean,IntegerValueBean,StringValueBean
public abstract class ValueBean extends java.lang.Object implements ReadableValue, WritableValue, java.io.Serializable
Default implementation for value beans.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcheckNotNull()static ValueBeanforType(DataType type)intgetArrayLength()voidgetBinary(int srcOffset, int length, byte[] dest, int destOffset)voidgetBinary(int offset, int length, java.io.OutputStream out)intgetBinaryLength()booleangetBoolean()protected abstract java.lang.ObjectgetBoxedValue()bytegetByte()chargetChar()doublegetDouble()UnboundDecodergetFieldDecoder()Used to read nested objectsUnboundEncodergetFieldEncoder(RecordClassDescriptor rcd)floatgetFloat()intgetInt()longgetLong()shortgetShort()ReadableValuenextReadableElement()WritableValuenextWritableElement()Returns a transient (reused by interface implementation) WritableValue object for the next element of the array.java.io.InputStreamopenBinary()voidsetArrayLength(int len)Set length of the array.java.lang.StringtoString()voidwriteBinary(byte[] data, int offset, int length)voidwriteBoolean(boolean value)voidwriteChar(char value)voidwriteDouble(double value)voidwriteFloat(float value)voidwriteInt(int value)voidwriteLong(long value)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface deltix.qsrv.hf.pub.ReadableValue
getString, isNull
-
Methods inherited from interface deltix.qsrv.hf.pub.WritableValue
writeNull, writeString
-
-
-
-
Field Detail
-
type
public final DataType type
-
-
Constructor Detail
-
ValueBean
protected ValueBean(DataType type)
-
-
Method Detail
-
checkNotNull
public void checkNotNull()
-
getBinary
public void getBinary(int offset, int length, java.io.OutputStream out) throws NullValueException- Specified by:
getBinaryin interfaceReadableValue- Throws:
NullValueException
-
getBinary
public void getBinary(int srcOffset, int length, byte[] dest, int destOffset) throws NullValueException- Specified by:
getBinaryin interfaceReadableValue- Throws:
NullValueException
-
getBinaryLength
public int getBinaryLength() throws NullValueException- Specified by:
getBinaryLengthin interfaceReadableValue- Throws:
NullValueException
-
getBoolean
public boolean getBoolean() throws NullValueException- Specified by:
getBooleanin interfaceReadableValue- Throws:
NullValueException
-
getChar
public char getChar() throws NullValueException- Specified by:
getCharin interfaceReadableValue- Throws:
NullValueException
-
getDouble
public double getDouble() throws NullValueException- Specified by:
getDoublein interfaceReadableValue- Throws:
NullValueException
-
getFloat
public float getFloat() throws NullValueException- Specified by:
getFloatin interfaceReadableValue- Throws:
NullValueException
-
getByte
public byte getByte() throws NullValueException- Specified by:
getBytein interfaceReadableValue- Throws:
NullValueException
-
getShort
public short getShort() throws NullValueException- Specified by:
getShortin interfaceReadableValue- Throws:
NullValueException
-
getInt
public int getInt() throws NullValueException- Specified by:
getIntin interfaceReadableValue- Throws:
NullValueException
-
getLong
public long getLong() throws NullValueException- Specified by:
getLongin interfaceReadableValue- Throws:
NullValueException
-
getArrayLength
public int getArrayLength() throws NullValueException- Specified by:
getArrayLengthin interfaceReadableValue- Throws:
NullValueException
-
nextReadableElement
public ReadableValue nextReadableElement() throws NullValueException
- Specified by:
nextReadableElementin interfaceReadableValue- Throws:
NullValueException
-
getFieldDecoder
public UnboundDecoder getFieldDecoder() throws NullValueException
Description copied from interface:ReadableValueUsed to read nested objects- Specified by:
getFieldDecoderin interfaceReadableValue- Throws:
NullValueException
-
openBinary
public java.io.InputStream openBinary() throws NullValueException- Specified by:
openBinaryin interfaceReadableValue- Throws:
NullValueException
-
writeBinary
public void writeBinary(byte[] data, int offset, int length)- Specified by:
writeBinaryin interfaceWritableValue
-
writeBoolean
public void writeBoolean(boolean value)
- Specified by:
writeBooleanin interfaceWritableValue
-
writeChar
public void writeChar(char value)
- Specified by:
writeCharin interfaceWritableValue
-
writeDouble
public void writeDouble(double value)
- Specified by:
writeDoublein interfaceWritableValue
-
writeFloat
public void writeFloat(float value)
- Specified by:
writeFloatin interfaceWritableValue
-
writeInt
public void writeInt(int value)
- Specified by:
writeIntin interfaceWritableValue
-
writeLong
public void writeLong(long value)
- Specified by:
writeLongin 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
-
getBoxedValue
protected abstract java.lang.Object getBoxedValue()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-