Interface TextNode

All Known Implementing Classes:
TextContainer, TokenizedParagraph, TokenizedSentence, TokenizedText, TokenizedWord

public interface TextNode
Interface for a node in a TextContainer tree.
  • Method Details

    • getChildCount

      int getChildCount()
      Get the number of direct children of this node.
      Returns:
      the child count of this node
    • getParent

      TextNode getParent()
      Get the parent node of this node or null if this node is the root.
      Returns:
      the parent node of this node
    • getPrevSibling

      TextNode getPrevSibling()
      Get the left sibling of this node or null if this node has no left sibling.
      Returns:
      the previous sibling node of this node
    • getNextSibling

      TextNode getNextSibling()
      Get the right sibling of this node or null if this node has no right sibling.
      Returns:
      the next sibling node of this node
    • getChildren

      List<TextContainer> getChildren()
      Get the ordered list of direct children of this node.
      Returns:
      a list of the child nodes
    • getIterator

      ListIterator<TextContainer> getIterator()
      Get an iterator over all descendants of this node including this node.
      Returns:
      a list iterator over the node and all descendants
    • getIterator

      Get an iterator over the node and all descendants of this node of the specified type.
      Parameters:
      type - the type of nodes to iterate over
      Returns:
      a list iterator over the selected nodes