public class FIXMessage extends Object
Constructor and Description |
---|
FIXMessage(FIXConfig config)
Construct a new message container.
|
FIXMessage(int maxFieldCount,
int fieldCapacity)
Construct a new message container.
|
Modifier and Type | Method and Description |
---|---|
FIXValue |
addField(int tag)
Add a field.
|
static FIXMessage |
fromString(String s)
Construct a new message container from a string representation.
|
boolean |
get(ByteBuffer buffer)
Read this message from a buffer.
|
int |
getFieldCount()
Get the number of fields.
|
long |
getMsgSeqNum()
Get the MsgSeqNum(34).
|
FIXValue |
getMsgType()
Get the MsgType(35).
|
int |
indexOf(int tag)
Get the index of the first instance of a field with the specified tag.
|
int |
indexOf(int tag,
int fromIndex)
Get the index of the first instance of a field with the specified tag,
starting at the specified index.
|
void |
put(ByteBuffer buffer)
Write this message to a buffer.
|
void |
reset()
Reset this message container.
|
void |
setFieldCount(int count)
Set the number of fields.
|
int |
tagAt(int index)
Get the tag at a specified index.
|
String |
toString()
Returns a string representation of this message.
|
void |
toString(StringBuilder builder)
Appends a string representation of this message to the specified string
builder.
|
FIXValue |
valueAt(int index)
Get the value container at a specified index.
|
FIXValue |
valueOf(int tag)
Get the value container of the first instance of a field with the
specified tag.
|
FIXValue |
valueOf(int tag,
int fromIndex)
Get the value container of the first instance of a field with the
specified tag, starting at the specified index.
|
public FIXMessage(FIXConfig config)
config
- the message configurationpublic FIXMessage(int maxFieldCount, int fieldCapacity)
maxFieldCount
- the maximum number of fieldsfieldCapacity
- the field capacitypublic FIXValue getMsgType()
null
if the field is not presentpublic long getMsgSeqNum()
public int tagAt(int index)
index
- the indexIndexOutOfBoundsException
- if the index exceeds the maximum
number of fieldspublic FIXValue valueAt(int index)
index
- the indexIndexOutOfBoundsException
- if the index exceeds the maximum
number of fieldspublic int getFieldCount()
public void setFieldCount(int count)
count
- the number of fieldspublic FIXValue valueOf(int tag)
tag
- the tagnull
if there are no instances
of a field with the specified tagpublic FIXValue valueOf(int tag, int fromIndex)
tag
- the tagfromIndex
- the index to start the search fromnull
if there are no instances
of a field with the specified tagpublic int indexOf(int tag)
tag
- the tagpublic int indexOf(int tag, int fromIndex)
tag
- the tagfromIndex
- the index to start the search frompublic FIXValue addField(int tag)
tag
- the tagIndexOutOfBoundsException
- if maximum number of fields is
exceededpublic void reset()
public boolean get(ByteBuffer buffer) throws FIXMessageOverflowException, FIXValueOverflowException
buffer
- a bufferFIXMessageOverflowException
- if the number of fields exceeds the
maximum number of fieldsFIXValueOverflowException
- if the length of a value exceeds the
capacity of the value containerpublic void put(ByteBuffer buffer)
buffer
- a bufferBufferOverflowException
- if there are fewer bytes remaining in
the buffer than what this message consists ofReadOnlyBufferException
- if the buffer is read-onlypublic static FIXMessage fromString(String s)
Note. This method allocates memory.
s
- a string representationpublic String toString()
Note. This method allocates memory.
public void toString(StringBuilder builder)
builder
- a string builderCopyright © 2021. All rights reserved.