Class RowTree.Node

Object
Node
Enclosing class:
RowTree

public static class RowTree.Node extends Object

Represents a single node or a RowTree. You can traverse the tree up/down/left/right from a single node.

A node may be "unplugged", in which case its getParent() is null. (Root nodes have RowTree's super-root as the parent.)

Public methods of Node are provided for traveral. All modifications should be done through RowTree.

  • Method Details

    • toString

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

      public String toFullString()
      Returns:
      lisp-style full printout
    • append

      public StringBuilder append(StringBuilder sb)
    • getRowId

      public long getRowId()
    • hasFlags

      public boolean hasFlags(int flagMask)
      Bitwise flag check.
      Parameters:
      flagMask - mask
      Returns:
      true if all flags specified in the mask are set
    • addFlags

      public void addFlags(int flagMask)
      Sets flags by mask.
      Parameters:
      flagMask - mask
    • getParent

      public RowTree.Node getParent()
    • getFirstChild

      public RowTree.Node getFirstChild()
    • getLastChild

      public RowTree.Node getLastChild()
    • getNextSibling

      public RowTree.Node getNextSibling()
    • getPrevSibling

      public RowTree.Node getPrevSibling()
    • writeTo

      public void writeTo(LongCollector rows, IntCollector depths, int depth)
      Dumps the sub-tree rooted at this node as parallel lists of rows and depths, to be later used as parameters for ArrayForest.
      Parameters:
      rows - rows recipient
      depths - depths recipient
      depth - starting depth for this node; if -1, this is a special case: this node is a super-root and must not write out its row ID (which is 0), but should proceed writing out children.
    • collectDirectChildren

      public void collectDirectChildren(LongCollector collector)
      Retrieves all direct children of the node
      Parameters:
      collector - recipient for row IDs
    • findFirstWithFlags

      public RowTree.Node findFirstWithFlags(int flags)
      Starting with this node and going into its sub-tree, tries to find the first node that has the specified flags set. Walks in LNR depth-first order.
      Parameters:
      flags - flags to look for
      Returns:
      node with the flags or null if not found