Interface ForestScanControl
- All Superinterfaces:
ForestIterationControl,IterationControl
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 Summary
Modifier and TypeMethodDescriptionlongintIntListLongListintskipParentSubtree(int depth) Skips the rest of the subtree rooted at one of the ancestor rows.intSkips the subtree rooted at the current row.Methods inherited from interface ForestIterationControl
getDepth, getForest, getIndexMethods inherited from interface IterationControl
cancel
-
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. Whendepthis equal to the current row's depth, the result is equal toskipSubtree(). Ifdepthis-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.
-