Class GenericTree

  • Direct Known Subclasses:
    GenericBranch, GenericLeaf

    public abstract class GenericTree
    extends java.lang.Object
    A generic tree representation of a parse.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.Map<java.lang.String,​java.lang.String> attributes
      The attributes.
      int leftExtent
      The left extent.
      int rightExtent
      The right extent.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAttribute​(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.
      GenericBranch getParent()
      Get the parent of this tree
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • attributes

        public final java.util.Map<java.lang.String,​java.lang.String> attributes
        The attributes.
      • leftExtent

        public final int leftExtent
        The left extent.
      • rightExtent

        public final int rightExtent
        The right extent.
    • 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.