com.epam.fix.message
Class MessageStructure

java.lang.Object
  extended by com.epam.fix.message.MessageStructure

public class MessageStructure
extends Object

User: Aliaksei_Kurnosau Date: 6/1/12 Time: 11:52 PM


Field Summary
protected  ArrayList<Integer> lengths
           
protected  ArrayList<Integer> tagIds
           
protected  ArrayList<com.epam.fix.message.ValueType> types
           
static int VARIABLE_LENGTH
          Special value for defining the size of field with variable value length
 
Constructor Summary
MessageStructure()
           
 
Method Summary
 void append(MessageStructure struct)
          Append fields to the end of current structure.
 boolean containsTagId(int tag)
           
 boolean equals(Object o)
           
 int getLength(int index)
           
 int getSize()
           
 int getTagId(int index)
           
 com.epam.fix.message.ValueType getType(int index)
           
 int hashCode()
           
 int indexOf(int tagId)
           
 int indexOfTag(int tag)
           
 void merge(MessageStructure struct)
           
 void reserve(int tagId, int length)
          Specifies tagId and size of the tag value.
 void reserve(int position, int tagId, int length)
          Specifies tagId and size of the tag value.
 void reserveLong(int tagId, int length)
           
 void reserveLong(int position, int tagId, int length)
           
 void reserveString(int tagId)
           
 void reserveString(int tagId, int length)
           
 void reserveString(int position, int tagId, int length)
           
 void setLength(int tagId, int length)
          Change the length for specific tag.
 void setLength(int tagId, int occurance, int length)
          Change the length for specific tag.
 void setLengthAtIndex(int tagIndex, int length)
           
 void setType(int tagId, int occurance, com.epam.fix.message.ValueType type)
           
 void setType(int tagId, com.epam.fix.message.ValueType type)
           
 void setTypeAtIndex(int tagIndex, com.epam.fix.message.ValueType type)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VARIABLE_LENGTH

public static final int VARIABLE_LENGTH
Special value for defining the size of field with variable value length

See Also:
Constant Field Values

tagIds

protected ArrayList<Integer> tagIds

lengths

protected ArrayList<Integer> lengths

types

protected ArrayList<com.epam.fix.message.ValueType> types
Constructor Detail

MessageStructure

public MessageStructure()
Method Detail

reserve

public void reserve(int tagId,
                    int length)
Specifies tagId and size of the tag value. All tags should be reserved in order like in generated message. Use MessageStructure.VARIABLE_LENGTH to define the tag value that could be increased dynamically for concrete parameter. Keep in mind, this will slow performance and spawn new Objects in runtime. Reserved field will be added to the end of the structure.

Parameters:
tagId - tagId
length - required amount of bytes for value or MessageStructure.VARIABLE_LENGTH.

reserveString

public void reserveString(int tagId)

reserveString

public void reserveString(int tagId,
                          int length)

reserveLong

public void reserveLong(int tagId,
                        int length)

reserve

public void reserve(int position,
                    int tagId,
                    int length)
Specifies tagId and size of the tag value. Reserved field will be inserted at specified position.

Parameters:
position - position to insent the tag
tagId - tagId
length - required amount of bytes for value or MessageStructure.VARIABLE_LENGTH.
See Also:
reserve(int, int)

reserveString

public void reserveString(int position,
                          int tagId,
                          int length)

reserveLong

public void reserveLong(int position,
                        int tagId,
                        int length)

getTagId

public int getTagId(int index)

getLength

public int getLength(int index)

getType

public com.epam.fix.message.ValueType getType(int index)

getSize

public int getSize()

containsTagId

public boolean containsTagId(int tag)

indexOfTag

public int indexOfTag(int tag)

append

public void append(MessageStructure struct)
Append fields to the end of current structure.

Parameters:
struct -

merge

public void merge(MessageStructure struct)

indexOf

public int indexOf(int tagId)

setLength

public void setLength(int tagId,
                      int length)
Change the length for specific tag.

Parameters:
tagId -
length - required amount of bytes for value or MessageStructure.VARIABLE_LENGTH.

setLength

public void setLength(int tagId,
                      int occurance,
                      int length)
Change the length for specific tag.

Parameters:
tagId -
occurance -
length - required amount of bytes for value or MessageStructure.VARIABLE_LENGTH.

setLengthAtIndex

public void setLengthAtIndex(int tagIndex,
                             int length)

setType

public void setType(int tagId,
                    com.epam.fix.message.ValueType type)

setType

public void setType(int tagId,
                    int occurance,
                    com.epam.fix.message.ValueType type)

setTypeAtIndex

public void setTypeAtIndex(int tagIndex,
                           com.epam.fix.message.ValueType type)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.