Class IndexedForest

Object
IndexedForest

public class IndexedForest extends Object
Forest-based indexes for common operations like getting parents, children, subtree or siblings. Thread-unsafe.
  • Constructor Details

    • IndexedForest

      public IndexedForest(Forest forest)
  • Method Details

    • subtreeEnd

      public int subtreeEnd(int idx)
    • parent

      public int parent(int idx)
    • children

      @NotNull public IntIterator children(int idx)
      Returns an iterator that provides indexes of all direct children at index idx. If idx is -1, returns roots.
    • roots

      @NotNull public IntIterator roots()
    • childrenRows

      public LongList childrenRows(int idx)
      Returns a list of children rows at index idx. If idx = -1, returns a list of roots.
    • firstChild

      public int firstChild(int idx)
      Returns the index of the first child under [idx]. If idx is equal to -1, returns the index of the first root (0).
    • nextSibling

      public int nextSibling(int idx)
    • depth

      public int depth(int idx)
    • row

      public long row(int idx)
    • rows

      public LongIterator rows(IntIterator indices)
    • size

      public int size()
    • getForest

      public Forest getForest()
    • root

      public int root(int idx)