org.apache.uima.cas.text

## Interface AnnotationTreeNode<T extends AnnotationFS>

-     public interface AnnotationTreeNode<T extends AnnotationFS>

  Represents a node in an annotation tree.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `get()` Return the annotation for this node.
    `AnnotationTreeNode<T>` | `getChild(int i)` Get the i-th child of this node.
    `int` | `getChildCount()` Get the number of children this node has.
    `ArrayList<AnnotationTreeNode<T>>` | `getChildren()` Get all children of this node as an ArrayList.
    `AnnotationTreeNode<T>` | `getNextSibling()` Get the next sibling (to the right) of this node.
    `AnnotationTreeNode<T>` | `getParent()` Get the parent of this node.
    `AnnotationTreeNode<T>` | `getPreviousSibling()` Get the previous sibling (to the left) of this node.

- - ### Method Detail

    - #### getParent

          AnnotationTreeNode<T> getParent()

      Get the parent of this node.
      Returns:
        The parent of this node, or `null` if this node has no parent (root).

    - #### getChildCount

          int getChildCount()

      Get the number of children this node has.
      Returns:
        The number of children.

    - #### getChild

          AnnotationTreeNode<T> getChild(int i)
                                  throws CASRuntimeException

      Get the i-th child of this node.
      Parameters:
        `i` - The index of the child.
      Returns:
        The i-th child.
      Throws:
        `CASRuntimeException` - If `i < 0` or `i >= getChildCount()`.

    - #### getNextSibling

          AnnotationTreeNode<T> getNextSibling()

      Get the next sibling (to the right) of this node.
      Returns:
        The right sibling of this node, or `null` if no such sibling exists.

    - #### getPreviousSibling

          AnnotationTreeNode<T> getPreviousSibling()

      Get the previous sibling (to the left) of this node.
      Returns:
        The left sibling of this node, or `null` if no such sibling exists.

    - #### getChildren

          ArrayList<AnnotationTreeNode<T>> getChildren()

      Get all children of this node as an ArrayList.
      Returns:
        An ArrayList of the children.

    - #### get

          T get()

      Return the annotation for this node.
      Returns:
        The annotation for this node.

Copyright © 2006–2018 The Apache Software Foundation. All rights reserved.