Package org.nineml.coffeegrinder.trees
Class GenericTree
- java.lang.Object
-
- org.nineml.coffeegrinder.trees.GenericTree
-
- Direct Known Subclasses:
GenericBranch,GenericLeaf
public abstract class GenericTree extends java.lang.ObjectA generic tree representation of a parse.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,java.lang.String>attributesThe attributes.intleftExtentThe left extent.intrightExtentThe right extent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAttribute(java.lang.String name, java.lang.String defaultValue)Get the value of an attribute.java.util.Map<java.lang.String,java.lang.String>getAttributes()Get all of the attributes as a map.java.util.List<GenericTree>getChildren()Get the children of this tree.GenericBranchgetParent()Get the parent of this tree
-
-
-
Method Detail
-
getParent
public GenericBranch getParent()
Get the parent of this tree- Returns:
- the parent.
-
getChildren
public java.util.List<GenericTree> getChildren()
Get the children of this tree.- Returns:
- the children.
-
getAttribute
public java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)Get the value of an attribute.- Parameters:
name- the name of the attribute.defaultValue- the default value if no such attribute exists.- Returns:
- the string value.
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Get all of the attributes as a map.- Returns:
- the attributes.
-
-