Class TextContainer

    • Constructor Detail

      • TextContainer

        protected TextContainer()
        Default constructor for empty text container.
      • TextContainer

        protected TextContainer​(TextElementType type,
                                List<? extends TextContainer> children)
        Construct a container of element type with the specified children.
        Parameters:
        type - the type of this text element
        children - the children of this container
      • TextContainer

        protected TextContainer​(TextElementType type,
                                String value)
        Construct a container of element type with a specific value.
        Parameters:
        type - the type of this text element
        value - the text value of this container
    • Method Detail

      • getChildCount

        public int getChildCount()
        Description copied from interface: TextNode
        Get the number of direct children of this node.
        Specified by:
        getChildCount in interface TextNode
        Returns:
        the child count of this node
      • getParent

        public TextNode getParent()
        Description copied from interface: TextNode
        Get the parent node of this node or null if this node is the root.
        Specified by:
        getParent in interface TextNode
        Returns:
        the parent node of this node
      • getPrevSibling

        public TextNode getPrevSibling()
        Description copied from interface: TextNode
        Get the left sibling of this node or null if this node has no left sibling.
        Specified by:
        getPrevSibling in interface TextNode
        Returns:
        the previous sibling node of this node
      • getNextSibling

        public TextNode getNextSibling()
        Description copied from interface: TextNode
        Get the right sibling of this node or null if this node has no right sibling.
        Specified by:
        getNextSibling in interface TextNode
        Returns:
        the next sibling node of this node
      • getChildren

        public List<TextContainer> getChildren()
        Description copied from interface: TextNode
        Get the ordered list of direct children of this node.
        Specified by:
        getChildren in interface TextNode
        Returns:
        a list of the child nodes
      • getIterator

        public ListIterator<TextContainer> getIterator()
        Description copied from interface: TextNode
        Get an iterator over all descendants of this node including this node.
        Specified by:
        getIterator in interface TextNode
        Returns:
        a list iterator over the node and all descendants
      • getIterator

        public ListIterator<TextContainer> getIterator​(TextElementType type)
        Description copied from interface: TextNode
        Get an iterator over the node and all descendants of this node of the specified type.
        Specified by:
        getIterator in interface TextNode
        Parameters:
        type - the type of nodes to iterate over
        Returns:
        a list iterator over the selected nodes