Utility class that offers static convenience methods for
often used tasks in conjunction with
INodeHierarchy
instances.
public static function elements(hierarchy:INodeHierarchy):Iterable
Returns all elements that are part of the hierarchy.
Parameters
Returns
| Iterable —
An enumeration of the contents of the hierarchy at the time of this invokation.
|
public static function getDescendants(hierarchy:INodeHierarchy, root:INode):Iterable
Returns all descendants of the provided item that are part of the hierarchy.
The enumeration will be top down, i.e. all of an item's ancestors will be enumerated
before the respective item.
Parameters
| hierarchy:INodeHierarchy — The hierarchy itself.
|
| |
| root:INode — The root item to get the descendants from.
|
Returns
| Iterable —
An enumeration of the children of the item at the time of this invokation
in reverse dfs prefix order.
|
public static function getDescendantsBottomUp(hierarchy:INodeHierarchy, root:INode):Iterable
Returns all descendants of the provided item that are part of the hierarchy.
The iteration will be bottom up, i.e. all of an item's children will
be iterated before the respective item.
Parameters
| hierarchy:INodeHierarchy — The hierarchy itself.
|
| |
| root:INode — The root item to get the descendants from.
|
Returns
| Iterable —
An iterable of the children of the item at the time of this invokation in dfs postfix order.
|
public static function getNearestCommonAncestor(hierarchy:INodeHierarchy, items:Iterator):INode
Determines the nearest common ancestor of the items provided in the hierarchy.
Parameters
| hierarchy:INodeHierarchy — The hierarchy itself.
|
| |
| items:Iterator — The items to find the nearest common ancestor of
|
Returns
public static function isDescendant(hierarchy:INodeHierarchy, node:INode, parent:INode):Boolean
Determines whether parent is a parent of node
Parameters
Returns
| Boolean — Whether parent is an ancestor of node.
|