Class RepeatingGroup

java.lang.Object
com.epam.fix.message.rg.RepeatingGroup
All Implemented Interfaces:
Iterable<RepeatingGroup.Entry>

public final class RepeatingGroup extends Object implements Iterable<RepeatingGroup.Entry>
Class for work with repeating group data. All repeating group data are stored at IndexedStorage, instances of this class is only view for repeating group data.
  • Constructor Details

    • RepeatingGroup

      public RepeatingGroup()
  • Method Details

    • removeEntry

      public void removeEntry(RepeatingGroup.Entry entry)
      Removes passed entry from group
      Parameters:
      entry - entry for remove
    • removeEntryAndClean

      public void removeEntryAndClean(RepeatingGroup.Entry entry)
      Removes passed entry from group and clean message - remove group instance if it is empty
      Parameters:
      entry - entry for remove
    • isValidationTurnOn

      public boolean isValidationTurnOn()
      Returns true if validation turn of for this group
      Returns:
      validation
    • setValidation

      public void setValidation(boolean validation)
      Turn on/off validation
      Parameters:
      validation - validation
    • release

      public void release()
      Returns group to pool if group was got by RepeatingGroupPool.getRepeatingGroup(). If group was got by calling RepeatingGroup addRepeatingGroup() method or RepeatingGroup getRepeatingGroup(), then it does nothing.
    • addEntry

      public RepeatingGroup.Entry addEntry()
      Adds entry to the end of group
      Returns:
      instance of Entry from RepeatingGroupPool. There is no need to call release for this object.
    • addEntry

      public RepeatingGroup.Entry addEntry(int index)
      Adds entry to the specific index at group.
      Parameters:
      index - number of entry in group. In other words, if adds first entry, then index equals to 0, if adds second entry, then index equals to 1 and so on.
      Returns:
      instance of Entry from RepeatingGroupPool. There is no need to call release for this object.
    • addEntry

      public void addEntry(int index, RepeatingGroup.Entry entry)
      Adds passed entry to the specific index at group.
      Parameters:
      index - number of entry in group. In other words, if adds first entry, then index equals to 0, if adds second entry, then index equals to 1 and so on.
      entry - entry for add
    • remove

      public void remove()
      Removes current group
    • removeEntry

      public void removeEntry(int index)
      Removes passed entry from the specific index.
      Parameters:
      index - number of entry in group. In other words, if adds first entry, then index equals to 0, if adds second entry, then index equals to 1 and so on.
    • removeEntryAndClean

      public void removeEntryAndClean(int index)
      Removes passed entry from the specific index.
      Parameters:
      index - number of entry in group. In other words, if adds first entry, then index equals to 0, if adds second entry, then index equals to 1 and so on.
    • getLeadingTagValue

      public int getLeadingTagValue()
      Returns value of group's leading tag.
      Returns:
      value of group's leading tag
    • getSize

      public int getSize()
      Returns number of entries in group.
      Returns:
      number of entries in group
    • getEntry

      public void getEntry(int index, RepeatingGroup.Entry entry)
      Fills passed entry instance by entry data.
      Parameters:
      index - number of entry in group. In other words, if adds first entry, then index equals to 0, if adds second entry, then index equals to 1 and so on.
      entry - entry for fill.
    • getEntry

      public RepeatingGroup.Entry getEntry(int index)
      Returns entry from specific instance.
      Parameters:
      index - number of entry in group. In other words, if adds first entry, then index equals to 0, if adds second entry, then index equals to 1 and so on.
      Returns:
      instance of Entry from RepeatingGroupPool, filled by entry data. There is no need to call release for this object.
    • getLeadingTag

      public int getLeadingTag()
      Returns group's leading tag
      Returns:
      leading tag of group
    • iterator

      public Iterator<RepeatingGroup.Entry> iterator()
      Returns iterator by entries of repeating group
      Specified by:
      iterator in interface Iterable<RepeatingGroup.Entry>
      Returns:
      iterator
    • toString

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

      public String toPrintableString()
    • toByteArray

      public byte[] toByteArray()
    • copyEntry

      Copy entry to end of repeating group
      Parameters:
      src - entry for copy
      Returns:
      copied entry
    • copyEntry

      public RepeatingGroup.Entry copyEntry(RepeatingGroup.Entry src, int index)
      Copy entry at specified index of repeating group
      Parameters:
      src - entry for copy
      index - index at which the source entry is to be copied
      Returns:
      copied entry
    • copyEntry

      public void copyEntry(RepeatingGroup.Entry src, RepeatingGroup.Entry dst)
      Copy entry to end of repeating group
      Parameters:
      src - entry for copy
      dst - entry for hold copied entry
    • copyEntry

      public void copyEntry(RepeatingGroup.Entry src, RepeatingGroup.Entry dst, int index)
      Copy entry at specified index of repeating group
      Parameters:
      src - entry for copy
      dst - entry for hold copied entry
      index - index at which the source entry is to be copied