Class MessageStructure

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

public class MessageStructure extends Object
User: Aliaksei_Kurnosau Date: 6/1/12 Time: 11:52 PM
  • Field Details

    • VARIABLE_LENGTH

      public static final int VARIABLE_LENGTH
      Special value for defining the size of field with variable value length
      See Also:
    • tagIds

      protected ArrayList<Integer> tagIds
    • lengths

      protected ArrayList<Integer> lengths
    • types

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

    • MessageStructure

      public MessageStructure()
  • Method Details

    • 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:
    • 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