Constructor and Description |
---|
TreeLayoutAdaptor(Tree root) |
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Tree> |
getChildren(Tree node)
Returns the children of a parent node.
|
java.lang.Iterable<Tree> |
getChildrenReverse(Tree node)
Returns the children of a parent node, in reverse order.
|
Tree |
getFirstChild(Tree parentNode)
Returns the first child of a parent node.
|
Tree |
getLastChild(Tree parentNode)
Returns the last child of a parent node.
|
Tree |
getRoot()
Returns the the root of the tree.
|
boolean |
isChildOfParent(Tree node,
Tree parentNode)
Tells if a node is a child of a given parentNode.
|
boolean |
isLeaf(Tree node)
Tells if a node is a leaf in the tree.
|
public TreeLayoutAdaptor(Tree root)
public boolean isLeaf(Tree node)
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
isLeaf
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
public boolean isChildOfParent(Tree node, Tree parentNode)
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
isChildOfParent
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
public Tree getRoot()
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
getRoot
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
public Tree getLastChild(Tree parentNode)
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
getLastChild
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
parentNode
- [!isLeaf(parentNode)]public Tree getFirstChild(Tree parentNode)
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
getFirstChild
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
parentNode
- [!isLeaf(parentNode)]public java.lang.Iterable<Tree> getChildrenReverse(Tree node)
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
getChildrenReverse
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
node
- [!isLeaf(parentNode)]public java.lang.Iterable<Tree> getChildren(Tree node)
org.abego.treelayout.TreeForTreeLayout
Time Complexity: O(1)
getChildren
in interface org.abego.treelayout.TreeForTreeLayout<Tree>
node
- [!isLeaf(parentNode)]