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 void
checkNotNull()
static ValueBean
forType(DataType type)
int
getArrayLength()
void
getBinary(int srcOffset, int length, byte[] dest, int destOffset)
void
getBinary(int offset, int length, java.io.OutputStream out)
int
getBinaryLength()
boolean
getBoolean()
protected abstract java.lang.Object
getBoxedValue()
byte
getByte()
char
getChar()
double
getDouble()
UnboundDecoder
getFieldDecoder()
Used to read nested objectsUnboundEncoder
getFieldEncoder(RecordClassDescriptor rcd)
float
getFloat()
int
getInt()
long
getLong()
short
getShort()
ReadableValue
nextReadableElement()
WritableValue
nextWritableElement()
Returns a transient (reused by interface implementation) WritableValue object for the next element of the array.java.io.InputStream
openBinary()
void
setArrayLength(int len)
Set length of the array.java.lang.String
toString()
void
writeBinary(byte[] data, int offset, int length)
void
writeBoolean(boolean value)
void
writeChar(char value)
void
writeDouble(double value)
void
writeFloat(float value)
void
writeInt(int value)
void
writeLong(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:
getBinary
in interfaceReadableValue
- Throws:
NullValueException
-
getBinary
public void getBinary(int srcOffset, int length, byte[] dest, int destOffset) throws NullValueException
- Specified by:
getBinary
in interfaceReadableValue
- Throws:
NullValueException
-
getBinaryLength
public int getBinaryLength() throws NullValueException
- Specified by:
getBinaryLength
in interfaceReadableValue
- Throws:
NullValueException
-
getBoolean
public boolean getBoolean() throws NullValueException
- Specified by:
getBoolean
in interfaceReadableValue
- Throws:
NullValueException
-
getChar
public char getChar() throws NullValueException
- Specified by:
getChar
in interfaceReadableValue
- Throws:
NullValueException
-
getDouble
public double getDouble() throws NullValueException
- Specified by:
getDouble
in interfaceReadableValue
- Throws:
NullValueException
-
getFloat
public float getFloat() throws NullValueException
- Specified by:
getFloat
in interfaceReadableValue
- Throws:
NullValueException
-
getByte
public byte getByte() throws NullValueException
- Specified by:
getByte
in interfaceReadableValue
- Throws:
NullValueException
-
getShort
public short getShort() throws NullValueException
- Specified by:
getShort
in interfaceReadableValue
- Throws:
NullValueException
-
getInt
public int getInt() throws NullValueException
- Specified by:
getInt
in interfaceReadableValue
- Throws:
NullValueException
-
getLong
public long getLong() throws NullValueException
- Specified by:
getLong
in interfaceReadableValue
- Throws:
NullValueException
-
getArrayLength
public int getArrayLength() throws NullValueException
- Specified by:
getArrayLength
in interfaceReadableValue
- Throws:
NullValueException
-
nextReadableElement
public ReadableValue nextReadableElement() throws NullValueException
- Specified by:
nextReadableElement
in interfaceReadableValue
- Throws:
NullValueException
-
getFieldDecoder
public UnboundDecoder getFieldDecoder() throws NullValueException
Description copied from interface:ReadableValue
Used to read nested objects- Specified by:
getFieldDecoder
in interfaceReadableValue
- Throws:
NullValueException
-
openBinary
public java.io.InputStream openBinary() throws NullValueException
- Specified by:
openBinary
in interfaceReadableValue
- Throws:
NullValueException
-
writeBinary
public void writeBinary(byte[] data, int offset, int length)
- Specified by:
writeBinary
in interfaceWritableValue
-
writeBoolean
public void writeBoolean(boolean value)
- Specified by:
writeBoolean
in interfaceWritableValue
-
writeChar
public void writeChar(char value)
- Specified by:
writeChar
in interfaceWritableValue
-
writeDouble
public void writeDouble(double value)
- Specified by:
writeDouble
in interfaceWritableValue
-
writeFloat
public void writeFloat(float value)
- Specified by:
writeFloat
in interfaceWritableValue
-
writeInt
public void writeInt(int value)
- Specified by:
writeInt
in interfaceWritableValue
-
writeLong
public void writeLong(long value)
- Specified by:
writeLong
in interfaceWritableValue
-
setArrayLength
public void setArrayLength(int len)
Description copied from interface:WritableValue
Set length of the array. It must be called prior to nextWritableElement- Specified by:
setArrayLength
in interfaceWritableValue
- Parameters:
len
- length of the array
-
nextWritableElement
public WritableValue nextWritableElement()
Description copied from interface:WritableValue
Returns 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:
nextWritableElement
in interfaceWritableValue
- Returns:
- reference to WritableValue object
-
getFieldEncoder
public UnboundEncoder getFieldEncoder(RecordClassDescriptor rcd)
- Specified by:
getFieldEncoder
in interfaceWritableValue
-
getBoxedValue
protected abstract java.lang.Object getBoxedValue()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-