org.abego.treelayout.TreeForTreeLayout interface by
defining just two simple methods and a constructor.
To use this class the underlying tree must provide the children as a list
(see getChildrenList(Object) and give direct access to the parent of
a node (see getParent(Object)).
See also DefaultTreeForTreeLayout.
| Modifier and Type | Field and Description |
|---|---|
| private final TreeNode |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Iterable | getChildren(TreeNode
[!isLeaf(parentNode)] node)Implements org. |
| public abstract List | Returns: the children of the given node. When node is a leaf the list is empty.Return the children of a node as a |
| public Iterable | getChildrenReverse(TreeNode
[!isLeaf(parentNode)] node)Implements org. |
| public TreeNode | getFirstChild(TreeNode
[!isLeaf(parentNode)] parentNode)Implements org. |
| public TreeNode | getLastChild(TreeNode
[!isLeaf(parentNode)] parentNode)Implements org. |
| public abstract TreeNode | Returns: [nullable] the parent of the node, or null when the node is a root.Returns the parent of a node, if it has one. |
| public TreeNode | getRoot()
Implements org. |
| public boolean | isChildOfParent(TreeNode
Implements org. |
| public boolean | isLeaf(TreeNode
Implements org. |
| root | back to summary |
|---|---|
| private final TreeNode root | |
| AbstractTreeForTreeLayout | back to summary |
|---|---|
| public AbstractTreeForTreeLayout(TreeNode root) | |
| getChildren | back to summary |
|---|---|
| public Iterable Implements org. Doc from org. Returns the children of a parent node. Time Complexity: O(1) | |
| getChildrenList | back to summary |
|---|---|
| public abstract List Return the children of a node as a Time Complexity: O(1) Also the access to an item of the list must have time complexity O(1). A client must not modify the returned list.
| |
| getChildrenReverse | back to summary |
|---|---|
| public Iterable Implements org. Doc from org. Returns the children of a parent node, in reverse order. Time Complexity: O(1) | |
| getFirstChild | back to summary |
|---|---|
| public TreeNode getFirstChild(TreeNode parentNode) Implements org. Doc from org. Returns the first child of a parent node. Time Complexity: O(1)
| |
| getLastChild | back to summary |
|---|---|
| public TreeNode getLastChild(TreeNode parentNode) Implements org. Doc from org. Returns the last child of a parent node. Time Complexity: O(1)
| |
| getParent | back to summary |
|---|---|
| public abstract TreeNode getParent(TreeNode node) Returns the parent of a node, if it has one. Time Complexity: O(1)
| |
| getRoot | back to summary |
|---|---|
| public TreeNode getRoot() Implements org. Doc from org. Returns the the root of the tree. Time Complexity: O(1)
| |
| isChildOfParent | back to summary |
|---|---|
| public boolean isChildOfParent(TreeNode node, TreeNode parentNode) Implements org. Doc from org. Tells if a node is a child of a given parentNode. Time Complexity: O(1)
| |
| isLeaf | back to summary |
|---|---|
| public boolean isLeaf(TreeNode node) Implements org. Doc from org. Tells if a node is a leaf in the tree. Time Complexity: O(1)
| |