Interface ForestScanControl

All Superinterfaces:
ForestIterationControl, IterationControl

public interface ForestScanControl extends ForestIterationControl
Lets an iteratee under Forest.scanDownwards(com.almworks.jira.structure.api.forest.raw.ForestScanner) control the iteration and receive additional information about the current position. Using methods provided by this class provides linear-speed iteration in many cases.
  • Method Details

    • getParent

      long getParent()
      Returns:
      parent of the current row, or 0 if the current row is a root
    • getParentIndex

      int getParentIndex()
      Returns:
      index of the parent of the current row, or -1 if the current row is a root
    • skipSubtree

      int skipSubtree()
      Skips the subtree rooted at the current row.
      Returns:
      the index of the next row to be iterated
      See Also:
    • skipParentSubtree

      int skipParentSubtree(int depth)
      Skips the rest of the subtree rooted at one of the ancestor rows.
      Parameters:
      depth - the depth of the ancestor, must be equal or less than the depth of the current row. When depth is equal to the current row's depth, the result is equal to skipSubtree(). If depth is -1, iteration skips to the end of the forest (thus ending the iteration).
      Returns:
      the index of the next row to be iterated
    • getSubtreeRows

      LongList getSubtreeRows()
      Returns:
      rows from the subtree rooted at the current row, including the row itself.
    • getParentPathIndexes

      IntList getParentPathIndexes()
      Returns:
      a list of indexes or rows that constitute current row's parent path. 0-th element is the index of the forest root, and the last element is the current index.