Class RowTree.Node
Object
Node
- Enclosing class:
- RowTree
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 Summary
Modifier and TypeMethodDescriptionvoidaddFlags(int flagMask) Sets flags by mask.append(StringBuilder sb) voidcollectDirectChildren(LongCollector collector) Retrieves all direct children of the nodefindFirstWithFlags(int flags) Starting with this node and going into its sub-tree, tries to find the first node that has the specified flags set.longgetRowId()booleanhasFlags(int flagMask) Bitwise flag check.toString()voidwriteTo(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 forArrayForest.
-
Method Details
-
toString
-
toFullString
- Returns:
- lisp-style full printout
-
append
-
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
-
getFirstChild
-
getLastChild
-
getNextSibling
-
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 forArrayForest.- Parameters:
rows- rows recipientdepths- depths recipientdepth- 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
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
-