public class FIXValue extends Object
Constructor and Description |
---|
FIXValue(int capacity)
Construct a new value container.
|
Modifier and Type | Method and Description |
---|---|
char |
asChar()
Get the value as a character.
|
long |
asCheckSum()
Get the value as a checksum.
|
void |
asDate(org.joda.time.MutableDateTime d)
Get the value as a date.
|
double |
asFloat()
Get the value as a float.
|
long |
asInt()
Get the value as an integer.
|
String |
asString()
Get the value as a string.
|
void |
asString(StringBuilder s)
Get the value as a string.
|
void |
asTimeOnly(org.joda.time.MutableDateTime t)
Get the value as a time only.
|
void |
asTimestamp(org.joda.time.MutableDateTime t)
Get the value as a timestamp.
|
byte |
byteAt(int index)
Get the byte at the specified index.
|
void |
copyTo(byte[] bytes)
Copy the value to a byte array.
|
boolean |
get(ByteBuffer buffer)
Read this value from a buffer.
|
int |
length()
Get the length of the value.
|
void |
put(ByteBuffer buffer)
Write this value to a buffer.
|
void |
reset()
Reset the value.
|
void |
set(FIXValue value)
Set the value.
|
void |
setChar(char c)
Set the value to a character.
|
void |
setCheckSum(long c)
Set the value to a checksum.
|
void |
setDate(org.joda.time.ReadableDateTime d)
Set the value to a date.
|
void |
setFloat(double f,
int decimals)
Set the value to a float.
|
void |
setInt(long i)
Set the value to an integer.
|
void |
setString(CharSequence s)
Set the value to a string.
|
void |
setTimeOnly(org.joda.time.ReadableDateTime t,
boolean millis)
Set the value to a time only.
|
void |
setTimestamp(org.joda.time.ReadableDateTime t,
boolean millis)
Set the value to a timestamp.
|
public FIXValue(int capacity)
capacity
- the capacitypublic byte byteAt(int index)
index
- the indexIndexOutOfBoundsException
- if the index is outside of this
value containerpublic int length()
public void copyTo(byte[] bytes)
bytes
- a byte arrayIndexOutOfBoundsException
- if the length of the value is greater
than the length of the byte arraypublic void reset()
public void set(FIXValue value)
value
- a value containerpublic char asChar()
FIXValueFormatException
- if the value is not a characterpublic void setChar(char c)
c
- a characterpublic long asInt()
FIXValueFormatException
- if the value is not an integerpublic void setInt(long i)
i
- an integerpublic double asFloat()
FIXValueFormatException
- if the value is not a floatpublic void setFloat(double f, int decimals)
f
- a floatdecimals
- the number of decimalspublic String asString()
public void asString(StringBuilder s)
s
- a string builderpublic void setString(CharSequence s)
s
- a stringIndexOutOfBoundsException
- if the string is too longpublic void asDate(org.joda.time.MutableDateTime d)
d
- a dateFIXValueFormatException
- if the value is not a datepublic void setDate(org.joda.time.ReadableDateTime d)
d
- a datepublic void asTimeOnly(org.joda.time.MutableDateTime t)
t
- a time onlyFIXValueFormatException
- if the value is not a time onlypublic void setTimeOnly(org.joda.time.ReadableDateTime t, boolean millis)
t
- a time onlymillis
- if true set milliseconds, otherwise do not set millisecondspublic void asTimestamp(org.joda.time.MutableDateTime t)
t
- a timestampFIXValueFormatException
- if the value is not a timestamppublic void setTimestamp(org.joda.time.ReadableDateTime t, boolean millis)
t
- a timestampmillis
- if true set milliseconds, otherwise do not set millisecondspublic long asCheckSum()
FIXValueFormatException
- if the value is not an integerpublic void setCheckSum(long c)
c
- a checksumpublic boolean get(ByteBuffer buffer) throws FIXValueOverflowException
buffer
- a bufferFIXValueOverflowException
- if the length of the value exceeds
the capacity of this value containerpublic void put(ByteBuffer buffer)
buffer
- a bufferBufferOverflowException
- if there are fewer bytes remaining in
the buffer than what this value consists ofReadOnlyBufferException
- if the buffer is read-onlyCopyright © 2018. All rights reserved.