Class EntryImpl

java.lang.Object
com.epam.fix.message.rg.EntryImpl
Direct Known Subclasses:
RepeatingGroup.Entry

public class EntryImpl extends Object
  • Field Details

    • storage

      protected IndexedStorage storage
    • group

      protected RepeatingGroup group
    • entryIndex

      protected int entryIndex
    • groupTags

      protected gnu.trove.set.hash.TIntHashSet groupTags
    • outerLeadingTags

      protected gnu.trove.set.hash.TIntHashSet outerLeadingTags
    • nestedLeadingTags

      protected gnu.trove.set.hash.TIntHashSet nestedLeadingTags
    • allocatedSubGroups

      protected ArrayList<RepeatingGroup> allocatedSubGroups
    • releaseNeeded

      protected boolean releaseNeeded
    • deleted

      protected boolean deleted
    • rgStorage

      protected RepeatingGroupStorage rgStorage
    • rgArray

      protected RepeatingGroupArray rgArray
    • entriesArray

      protected EntriesArray entriesArray
  • Constructor Details

    • EntryImpl

      public EntryImpl()
  • Method Details

    • addRepeatingGroup

      public RepeatingGroup addRepeatingGroup(int leadingTag)
      Adds sub group to entry. Validation for this group is turned off.
      Parameters:
      leadingTag - leading tag for repeating group.
      Returns:
      instance of RepeatingGroup from RepeatingGroupPool. There is no need to call release for this object.
    • addRepeatingGroup

      public void addRepeatingGroup(int leadingTag, RepeatingGroup group)
    • addRepeatingGroup

      public RepeatingGroup addRepeatingGroup(int leadingTag, boolean validation)
      Adds sub group to entry.
      Parameters:
      leadingTag - leading tag for repeating group.
      validation - turn on/off validation
      Returns:
      instance of RepeatingGroup from RepeatingGroupPool. There is no need to call release for this object.
    • addRepeatingGroup

      public void addRepeatingGroup(int leadingTag, boolean validation, RepeatingGroup subGroup)
      Adds sub group to entry.
      Parameters:
      leadingTag - leading tag for repeating group.
      validation - turn on/off validation.
      subGroup - group for further work.
    • addTag

      public int addTag(TagValue tagValue)
      Adds tagValue to entry.
      Parameters:
      tagValue - value for add.
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, byte[] value)
      Adds tag to entry.
      Parameters:
      tag - tag for add
      value - value for add
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, boolean value)
      Adds tag to entry.
      Parameters:
      tag - tag for add
      value - value for add
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, byte[] value, int offset, int length)
      Adds tag to entry.
      Parameters:
      tag -
      value - byte array for add
      offset - offset in passed array
      length - length of array that will be added
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, double value, int precision)
      Adds tag to entry.
      Parameters:
      tag - tag for add
      value - value for add
      precision - precision of value rounding
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, long value)
      Adds tag to entry.
      Parameters:
      tag - tag for add
      value - value for add
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, CharSequence value)
      Adds tag to entry.
      Parameters:
      tag - tag for add
      value - value for add
      Returns:
      index in message (not in group or entry) in which value was added
    • addTag

      public int addTag(int tag, Calendar value, FIXDateFormatterFactory.FIX_DATE_TYPE type)
      Adds tag to entry.
      Parameters:
      tag - tag for add
      value - value for add
      type - type of date
      Returns:
      index in message (not in group or entry) in which value was added
    • updateValue

      public int updateValue(TagValue tagValue, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tagValue
      Parameters:
      tagValue - tagValue for update
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, byte[] value, int offset, int length, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      value - new value for tag
      offset - offset in passed array
      length - length of array that will be added
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, byte[] value, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      value - new value for tag
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, long value, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      value - new value for tag
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, double value, int precision, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      value - new value for tag
      precision - precision of value rounding
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, CharSequence strBuffer, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      strBuffer - new value for tag
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, boolean value, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      value - new value for tag
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • updateValue

      public int updateValue(int tag, Calendar value, FIXDateFormatterFactory.FIX_DATE_TYPE type, IndexedStorage.MISSING_TAG_HANDLING addIfNotExists)
      Updates tag value
      Parameters:
      tag - tag for update
      value - new value for tag
      type - type of date
      addIfNotExists - determines the behavior in case if tag is not exists
      Returns:
      index of updated value in fix message (not in group or entry)
    • isTagExists

      public boolean isTagExists(int tag)
      Returns true if tag exists in entry
      Parameters:
      tag - tag for check
      Returns:
      is tag exists
    • getTag

      public void getTag(int tag, TagValue dest)
      Fills passed TagValue object by tag data
      Parameters:
      tag - tag for find
      dest - object for fill
    • getTagValueAsString

      public String getTagValueAsString(int tag)
      Returns tag value as string
      Parameters:
      tag - tag for find
      Returns:
      tag value
    • getTagValueAsBytes

      public byte[] getTagValueAsBytes(int tag)
      Returns tag value as byte array
      Parameters:
      tag - tag for find
      Returns:
      tag value
    • getTagValueAsBytes

      public int getTagValueAsBytes(int tag, byte[] dest, int offset)
      Returns tag value as byte array
      Parameters:
      tag - tag for find
      dest - array for fill
      offset - start index in passed array from which array will filled
      Returns:
      length of wrote data
    • getTagValueAsByte

      public byte getTagValueAsByte(int tag)
      Returns first byte of tag value
      Parameters:
      tag - tag for find
      Returns:
      first byte of tag value
    • getTagValueAsByte

      public byte getTagValueAsByte(int tag, int offset)
      Returns byte of tag value at offset
      Parameters:
      tag - tag for find
      Returns:
      byte of tag value
    • getTagValueAsBool

      public boolean getTagValueAsBool(int tag)
      Returns tag value as boolean
      Parameters:
      tag - tag for find
      Returns:
      tag value
    • getTagValueAsDouble

      public double getTagValueAsDouble(int tag)
      Returns tag value as double
      Parameters:
      tag - tag for find
      Returns:
      tag value
    • getTagValueAsLong

      public long getTagValueAsLong(int tag)
      Returns tag value as long
      Parameters:
      tag - tag for find
      Returns:
      tag value
    • getTagValueAsStringBuff

      public void getTagValueAsStringBuff(int tag, StringBuffer str)
      Fills passed StringBuffer by tag value
      Parameters:
      tag - tag for find
      str - buffer for filled
    • getTagAtIndex

      public void getTagAtIndex(int index, TagValue dest)
      Fills passed TagValue object by tag data from index
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      dest - object for fill
    • getTagValueAsStringAtIndex

      public String getTagValueAsStringAtIndex(int index)
      Returns tag value as string
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      tag value
    • getTagValueAsBytesAtIndex

      public byte[] getTagValueAsBytesAtIndex(int index)
      Returns tag value as byte array
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      tag value
    • getTagValueAsBytesAtIndex

      public int getTagValueAsBytesAtIndex(int index, byte[] dest, int offset)
      Returns tag value as byte array
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      dest - array for fill
      offset - start index in passed array from which array will filled
      Returns:
      length of wrote data
    • getTagValueAsByteAtIndex

      public byte getTagValueAsByteAtIndex(int index)
      Returns first byte of tag value
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      first byte of tag value
    • getTagValueAsByteAtIndex

      public byte getTagValueAsByteAtIndex(int index, int offset)
      Returns byte of tag value at offset
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      byte of tag value
    • getTagValueAsBoolAtIndex

      public boolean getTagValueAsBoolAtIndex(int index)
      Returns tag value as boolean
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      tag value
    • getTagValueAsDoubleAtIndex

      public double getTagValueAsDoubleAtIndex(int index)
      Returns tag value as double
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      tag value
    • getTagValueAsLongAtIndex

      public long getTagValueAsLongAtIndex(int index)
      Returns tag value as long
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      tag value
    • getTagValueAsStringBuffAtIndex

      public void getTagValueAsStringBuffAtIndex(int index, StringBuffer str)
      Fills passed StringBuffer by tag value
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      str - buffer for filled
    • getRepeatingGroupAtIndex

      public RepeatingGroup getRepeatingGroupAtIndex(int index)
      Returns repeating group
      Parameters:
      index - number of leading tag of group in entry (not in entire FIX message)
      Returns:
      instance of RepeatingGroup from RepeatingGroupPool. There is no need to call release for this object.
    • getRepeatingGroupAtIndex

      public void getRepeatingGroupAtIndex(int index, RepeatingGroup group)
      Fills repeating group by repeating group data
      Parameters:
      index - number of leading tag of group in entry (not in entire FIX message)
      group - repeating group object for fill
    • removeTag

      public boolean removeTag(int tag)
      Removes tag from entry
      Parameters:
      tag - tag for remove
      Returns:
      is tag was removes
    • removeTagAtIndex

      public boolean removeTagAtIndex(int index)
      Removes tag from entry by index
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      is tag was removes
    • removeRepeatingGroup

      public boolean removeRepeatingGroup(int leadingTag)
      Removes repeating group from entry
      Parameters:
      leadingTag - leading tag of repeating group
      Returns:
      true if repeating group was deleted
    • removeRepeatingGroupAtIndex

      public boolean removeRepeatingGroupAtIndex(int index)
      Removes repeating group from entry
      Parameters:
      index - index of leading tag group in entry (not in entire FIX message)
      Returns:
      true if repeating group was deleted
    • getOrAddRepeatingGroup

      public RepeatingGroup getOrAddRepeatingGroup(int leadingTag)
      Returns repeating group from entry by leading tag. If group doesn't exist, it will be added.
      Parameters:
      leadingTag - leading tag for repeating group
      Returns:
      instance of RepeatingGroup from RepeatingGroupPool. There is no need to call release for this object.
    • getOrAddRepeatingGroup

      public void getOrAddRepeatingGroup(int leadingTag, RepeatingGroup group)
      Fills passed repeating group instance by data from entry. If group doesn't exist, it will be added.
      Parameters:
      leadingTag - leading tag for repeating group
      group - repeating group object for fill
    • isRepeatingGroupExists

      public boolean isRepeatingGroupExists(int leadingTag)
      Checks is entry contains nested group with passed leading tag. Note that empty groups, that doesn't appear in the message, also considered existing
      Parameters:
      leadingTag - leading tag for check
      Returns:
      true if repeating group with passed leading tag exists.
    • isGroupTag

      public boolean isGroupTag(int tag)
      Checks whether tag is leading tag of group
      Parameters:
      tag - tag for check
      Returns:
      true if tag is leading tag of group, false if tag doesn't exists or is not leading tag of group
    • isGroupTagAtIndex

      public boolean isGroupTagAtIndex(int index)
      Checks whether tag is group tag at index
      Parameters:
      index - number of tag in entry (not in entire FIX message)
      Returns:
      true if tag is group tag
    • getTagIndex

      public int getTagIndex(int tag)
    • clear

      public void clear()
    • getRepeatingGroup

      public RepeatingGroup getRepeatingGroup(int leadingTag)
      Returns repeating group from entry by leading tag
      Parameters:
      leadingTag - leading tag for repeating group
      Returns:
      instance of RepeatingGroup from RepeatingGroupPool. There is no need to call release for this object.
    • getRepeatingGroup

      public void getRepeatingGroup(int leadingTag, RepeatingGroup group)
      Fills passed repeating group instance by data from entry
      Parameters:
      leadingTag - leading tag for repeating group
      group - repeating group object for fill
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toPrintableString

      public String toPrintableString()
    • getSize

      public int getSize()
      Returns number of added tag in entry
      Returns:
      number of added tag in entry
    • size

      public int size()
      Returns number of added tag in entry
      Returns:
      number of added tag in entry
    • getGroup

      public RepeatingGroup getGroup()
      Returns group which owns entry
      Returns:
      group which owns entry
    • isEmpty

      public boolean isEmpty()
    • getEntryIndex

      public int getEntryIndex()
      Returns entry index in FIX message
      Returns:
      entry index in FIX message
    • toByteArray

      public byte[] toByteArray()
    • copyRepeatingGroup

      public RepeatingGroup copyRepeatingGroup(RepeatingGroup source)
      Copy repeating group to entry
      Parameters:
      source - repeating group for copy
      Returns:
      copied repeating group
    • copyRepeatingGroup

      public void copyRepeatingGroup(RepeatingGroup source, RepeatingGroup dst)
      Copy repeating group to entry
      Parameters:
      source - repeating group for copy
      dst - entry for hold copied repeating group