Class Node

  • All Implemented Interfaces:
    java.lang.Iterable<Leaf>, ParsedPattern
    Direct Known Subclasses:
    List, WriterNode

    public abstract class Node
    extends Leaf
    implements java.lang.Iterable<Leaf>
    Node is a Leaf that has children. getting and setting the parent of a node, and for removing a node.
    Since:
    1.6, SAAJ 1.2 Children are orderless.
    Author:
    Kohsuke Kawaguchi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Leaf leaf
      Children of this node.
      • Fields inherited from class com.sun.tools.txw2.model.Leaf

        location
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Node​(org.xml.sax.Locator location, Leaf leaf)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChild​(Leaf child)
      Adds the given Leaf and their sibling as children of this Node.
      boolean hasOneChild()
      Returns true if this node has only one child node.
      java.util.Iterator<Leaf> iterator()
      Iterates all the children.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • leaf

        public Leaf leaf
        Children of this node.
    • Constructor Detail

      • Node

        protected Node​(org.xml.sax.Locator location,
                       Leaf leaf)
    • Method Detail

      • iterator

        public final java.util.Iterator<Leaf> iterator()
        Iterates all the children.
        Specified by:
        iterator in interface java.lang.Iterable<Leaf>
      • hasOneChild

        public final boolean hasOneChild()
        Returns true if this node has only one child node.
      • addChild

        public final void addChild​(Leaf child)
        Adds the given Leaf and their sibling as children of this Node.