|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bioinfweb.treegraph.document.TreePath
public class TreePath
This class stores the path to an node from the root of the tree or a specified ancestor. It can be used to find equivalent nodes in different trees.
Field Summary | |
---|---|
private Vector<Integer> |
path
|
Constructor Summary | |
---|---|
TreePath(Node leaf)
Creates a path from the specified leaf to the root of the tree. |
|
TreePath(Node leaf,
Node ancestor)
Creates a path from the specified leaf to the specified ancestor (not including the ancestor itself). |
Method Summary | |
---|---|
int |
comparePosition(TreePath other)
Calculates which of the two target nodes is further upwards in the tree. |
Node |
findNode(Node root)
Finds the node specidied by the stored path relative to the given root node. |
int |
getPosition(int level)
Returns the position in this path on the specified level. |
int |
length()
Returns the length of the path. |
private void |
setPath(Node end,
Node ancestor)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Vector<Integer> path
Constructor Detail |
---|
public TreePath(Node leaf)
leaf
- public TreePath(Node leaf, Node ancestor)
leaf
- ancestor
- Method Detail |
---|
private void setPath(Node end, Node ancestor)
public Node findNode(Node root)
root
- the start of the path
public int comparePosition(TreePath other)
other
- the path that leads to the node that should be compared with the
target of this path (The given path has to allude to the same tree as the path
contained in this object.)
public int getPosition(int level)
level
- the level in the path where the leaf is on the deepest level (with the highest index)
public int length()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |