public class Tree<T> extends Object implements Serializable
Constructor and Description |
---|
Tree()
Default constructor for a tree.
|
Tree(T label)
Creates a tree with just the root.
|
public Tree()
The constructed tree will not have any label, children.
public Tree(T label)
label
- : The data stored in the root of the tree.public void addLeaf(T leafLabel)
public static Tree<String> readTreeFromString(String treeString)
public T getLabel()
public T getEdgeLabel(int childId)
public int size()
public boolean isLeaf()
public int getNumberOfChildren()
public boolean isRoot()
public int getHeight()
public int getPositionAmongParentsChildren()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void removeChildAt(int position)
public boolean hasEdgeLabels()
Copyright © 2017. All rights reserved.