Package ptolemy.actor.ptalon
Class NamedTree<TreeType extends NamedTree>
- java.lang.Object
-
- ptolemy.actor.ptalon.NamedTree<TreeType>
-
- Direct Known Subclasses:
AbstractPtalonEvaluator.IfTree
public abstract class NamedTree<TreeType extends NamedTree> extends java.lang.Object
This class is used for generic trees, where each node has a name. Subclasses will typically should set TreeType to be the subclass itself. For instance, IfTree extends NamedTree < IfTree >.- Since:
- Ptolemy II 6.1
- Version:
- $Id$
- Author:
- Adam Cataldo, Elaine Cheong
- Pt.AcceptedRating:
- Red (celaine)
- Pt.ProposedRating:
- Red (celaine)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
NamedTree
public NamedTree(TreeType parent, java.lang.String name)
Create a new tree with the specified parent. This is null if the tree to create is a root.- Parameters:
parent
- The parent for this tree.name
- The name for this tree.
-
-
Method Detail
-
addChild
public abstract TreeType addChild(java.lang.String name)
Create a new child tree to this tree with the specified name and return it.- Parameters:
name
- The name of the child.- Returns:
- The child TreeType.
-
getChild
public TreeType getChild(java.lang.String name)
Returns the child with the specified name.- Parameters:
name
- The name for the desired child.- Returns:
- A child with the specified name, if there is any, or null otherwise.
-
getChildren
public java.util.List<TreeType> getChildren()
Returns the children of this tree.- Returns:
- The children of this tree.
-
getName
public java.lang.String getName()
Returns the name associated with this tree.- Returns:
- The name associated with this tree.
-
getParent
public TreeType getParent()
Returns the parent of this tree.- Returns:
- The parent of this tree.
-
getProperAncestors
public java.util.List<TreeType> getProperAncestors()
Return the ancestors of this tree, not including this tree.- Returns:
- The ancestors of this tree, not including this tree.
-
-