public abstract class NamedTree<TreeType extends NamedTree>
extends java.lang.Object
Red (celaine) |
Red (celaine) |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<TreeType> |
_children
The children of this tree.
|
protected java.lang.String |
_name
The name of this tree.
|
protected TreeType |
_parent
The parent of this tree.
|
Constructor and Description |
---|
NamedTree(TreeType parent,
java.lang.String name)
Create a new tree with the specified parent.
|
Modifier and Type | Method and Description |
---|---|
abstract TreeType |
addChild(java.lang.String name)
Create a new child tree to this tree with the specified
name and return it.
|
TreeType |
getChild(java.lang.String name)
Returns the child with the specified name.
|
java.util.List<TreeType> |
getChildren()
Returns the children of this tree.
|
java.lang.String |
getName()
Returns the name associated with this tree.
|
TreeType |
getParent()
Returns the parent of this tree.
|
java.util.List<TreeType> |
getProperAncestors()
Return the ancestors of this tree, not including this tree.
|
public NamedTree(TreeType parent, java.lang.String name)
parent
- The parent for this tree.name
- The name for this tree.public abstract TreeType addChild(java.lang.String name)
name
- The name of the child.public TreeType getChild(java.lang.String name)
name
- The name for the desired child.public java.util.List<TreeType> getChildren()
public java.lang.String getName()
public TreeType getParent()
public java.util.List<TreeType> getProperAncestors()