org.abego.treelayout.TreeForTreeLayout
interface, applicable to any type of tree node.
It allows you to create a tree "from scratch", without creating any new class.
To create a tree you must provide the root of the tree (see
DefaultTreeForTreeLayout(Object). Then you can incrementally
construct the tree by adding children to the root or other nodes of the tree
(see addChild(Object, Object) and
addChildren(Object, Object.).
| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private List | |
| private Map |
| Access | Constructor and Description |
|---|---|
| public | DefaultTreeForTreeLayout(TreeNode
the node to be used as the root. root)Creates a new instance with a given node as the root |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public List | getChildrenList(TreeNode
Implements abstract org. List.
|
| private List | |
| public TreeNode | getParent(TreeNode
Implements abstract org. |
| public boolean |
| childrenMap | back to summary |
|---|---|
| private Map<TreeNode, List<TreeNode>> childrenMap | |
| emptyList | back to summary |
|---|---|
| private List<TreeNode> emptyList | |
| parents | back to summary |
|---|---|
| private Map<TreeNode, TreeNode> parents | |
| DefaultTreeForTreeLayout | back to summary |
|---|---|
| public DefaultTreeForTreeLayout(TreeNode root) Creates a new instance with a given node as the root
| |
| addChild | back to summary |
|---|---|
public void addChild(TreeNode parentNode, TreeNode node)
| |
| addChildren | back to summary |
|---|---|
| public void addChildren(TreeNode parentNode, TreeNode... nodes) | |
| getChildrenList | back to summary |
|---|---|
| public List Implements abstract org. Doc from org. 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. | |
| getEmptyList | back to summary |
|---|---|
| private List | |
| getParent | back to summary |
|---|---|
| public TreeNode getParent(TreeNode node) Implements abstract org. Doc from org. Returns the parent of a node, if it has one. Time Complexity: O(1)
| |
| hasNode | back to summary |
|---|---|
public boolean hasNode(TreeNode node)
| |