public class SimpleTreeFactory extends java.lang.Object implements TreeFactory
SimpleTreeFactory acts as a factory for creating objects
of class SimpleTree.
NB: A SimpleTree stores tree geometries but no node labels. Make sure
this is what you really want.| Constructor and Description |
|---|
SimpleTreeFactory()
Creates a new
TreeFactory. |
| Modifier and Type | Method and Description |
|---|---|
Tree |
newLeaf(Label word)
Create a new tree leaf node, with the given label.
|
Tree |
newLeaf(java.lang.String word)
Create a new tree leaf node, where the label is formed from
the
String passed in. |
Tree |
newTreeNode(Label parentLabel,
java.util.List<Tree> children)
Create a new tree non-leaf node, with the given label.
|
Tree |
newTreeNode(java.lang.String parent,
java.util.List<Tree> children)
Create a new tree non-leaf node, where the label is formed from
the
String passed in. |
public SimpleTreeFactory()
TreeFactory. A
SimpleTree stores no Label, so no
LabelFactory is built.public Tree newLeaf(java.lang.String word)
TreeFactoryString passed in.newLeaf in interface TreeFactoryword - The word that will go into the tree label.public Tree newLeaf(Label word)
TreeFactorynewLeaf in interface TreeFactoryword - The label for the leaf nodepublic Tree newTreeNode(java.lang.String parent, java.util.List<Tree> children)
TreeFactoryString passed in.newTreeNode in interface TreeFactoryparent - The string that will go into the parent tree label.children - The list of daughters of this tree. The children
may be a (possibly empty) List of children or
nullpublic Tree newTreeNode(Label parentLabel, java.util.List<Tree> children)
TreeFactorynewTreeNode in interface TreeFactoryparentLabel - The label for the parent tree node.children - The list of daughters of this tree. The children
may be a (possibly empty) List of children or
null