Name | Arguments | Description |
addChild
| node ...
|
Adds node's to the end of the child list.
|
bfsAllNodes
| |
Returns an array of all the nodes in the (sub)tree starting from this node
in a breadth-first search.
|
dfsAllNodes
| |
Returns an array of all the nodes in the (sub)tree starting from this node
in a depth-first search.
|
find
| filterFunction
|
Returns an array of nodes that are qualified by filterFunction.
|
findByKey
| key
|
The key is a text name. Uses the getKey() to find
a match and returns the mached node, or null if no match is found.
|
getCascade
| attrName
|
Returns the value for the key named attrName; if such a key does
not exist in the current node, it traces all the way to the root until either a
value is found or root is reached.
|
getChildren
| |
Returns an array of all the immediate children nodes.
|
getKey
| |
Returns a "key" for this node, which typically should be unique among all the
nodes in the tree. This is used by the findByKey() method.
By default, it returns what toString() returns. This method is
likely overridden in the derived class.
|
getLevel
| |
Returns the depth of this node in the tree. The level of the root of a tree is 0.
|
getParent
| |
Returns the parant node, or null if this is the root of the tree.
|
getPath
| |
Returns an array of nodes that is the path from the root of the tree up to
this node (self is not included).
|
hasInPath
| node
|
Returns true if node is in the path from the root of the tree
to this node.
|
isLeaf
| |
Returns true if this node has no children.
|
sortChildren
| comparator
|
Sorts the children, either with the supplied comparator if
present or with the default comparator.
|
sortChildrenWholeTree
| comparator
|
Sorts the children for all the nodes in the subtree rooted at this node,
either with the supplied comparator if present or with the
default comparator.
|
| |
Sets node to be the parent.
|
getTop
| |
Returns the root of the tree that this node resides in. It can be self.
|
isTop
| |
Returns true if this is the root of the tree (without a parent).
|
transposeTree
| type
|
Transposes all the nodes in the subtree rooted at this node into the new
type. The type must represent a user-defined
class that extends treeNode .
|