|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.orsay.lri.varna.models.treealign.Tree<T>
T
- The type of values on nodes.public class Tree<T>
An object of this class is a rooted tree, where children are ordered. The tree is iterable, and the default iterator is DFS (depth-first search), with the fathers given before the children.
Nested Class Summary | |
---|---|
class |
Tree.DFSPrefixIterator
An iterator that returns the nodes in prefix (fathers before children) DFS (go deep first) order. |
Field Summary | |
---|---|
private List<Tree<T>> |
children
|
private Tree<T> |
tree
|
private T |
value
|
Constructor Summary | |
---|---|
Tree()
Creates a tree, with an empty list of children. |
|
Tree(Iterable<Tree<T>> children)
Creates a tree, with the given set of children. |
Method Summary | |
---|---|
int |
computeDegree()
Compute the tree degree, ie. |
int |
countNodes()
Count the nodes in the tree. |
List<Tree<T>> |
getChildren()
Returns the list of children. |
T |
getValue()
|
Iterator<Tree<T>> |
iterator()
|
void |
replaceChildrenListBy(List<Tree<T>> children)
This method replaces the list of children of a tree with the list given as argument. |
int |
rootDegree()
Returns the number of children of the root node. |
void |
setValue(T value)
|
String |
toGraphvizNodeId()
Returns a string unique to this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private List<Tree<T>> children
private T value
private Tree<T> tree
Constructor Detail |
---|
public Tree(Iterable<Tree<T>> children)
public Tree()
Method Detail |
---|
public T getValue()
public void setValue(T value)
public List<Tree<T>> getChildren()
public void replaceChildrenListBy(List<Tree<T>> children)
children
- the new list of childrenpublic int rootDegree()
public int countNodes()
public int computeDegree()
public String toGraphvizNodeId()
public Iterator<Tree<T>> iterator()
iterator
in interface Iterable<Tree<T>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |