|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object learner.Tree
public class Tree
Represents ordered, labelled trees.
Field Summary | |
---|---|
protected RankedSymbol |
root
The ranked symbol that consitutes this node. |
protected java.util.Vector<Tree> |
subtrees
The subtrees of the current node. |
Constructor Summary | |
---|---|
Tree(RankedSymbol root,
java.util.Vector<Tree> subtrees)
Constructs a new labelled tree with root node root and
subtrees as defined by subtrees . |
|
Tree(java.lang.String tree)
Constructs a new labelled tree from a string. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object o)
|
boolean |
equals(Tree t)
|
RankedSymbol |
getRoot()
Getter function for the root label. |
java.util.Vector<Tree> |
getSubtrees()
|
int |
hashCode()
|
int |
size()
|
Tree |
subst(Tree tree)
Replaces every occurence of the special symbol "O" with the labelled tree tree . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<Tree> subtrees
protected RankedSymbol root
Constructor Detail |
---|
public Tree(RankedSymbol root, java.util.Vector<Tree> subtrees)
root
and
subtrees as defined by subtrees
.
root
- a ranked symbolsubtrees
- a vector of labelled trees, whose lengths equals the rank of
root
public Tree(java.lang.String tree)
Tree(String)
.
tree
- A String description of the labelled tree that is to be
constructed. It is very important that the string is correctly
formatted, as the validation performed by the function itself
is leaves a lot to wish for.Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(Tree t)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public RankedSymbol getRoot()
public java.util.Vector<Tree> getSubtrees()
public Tree subst(Tree tree)
tree
.
tree
- The tree that is to be substituted into this context.
public int size()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |