com.sun.tools.txw2.model
Class Node

java.lang.Object
  extended by com.sun.tools.txw2.model.Leaf
      extended by com.sun.tools.txw2.model.Node
All Implemented Interfaces:
Iterable<Leaf>, org.kohsuke.rngom.ast.om.ParsedPattern
Direct Known Subclasses:
List, WriterNode

public abstract class Node
extends Leaf
implements Iterable<Leaf>

Node is a Leaf that has children. Children are orderless.

Author:
Kohsuke Kawaguchi

Field Summary
 Leaf leaf
          Children of this node.
 
Fields inherited from class com.sun.tools.txw2.model.Leaf
location
 
Constructor Summary
protected Node(Locator location, Leaf leaf)
           
 
Method Summary
 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.
 Iterator<Leaf> iterator()
          Iterates all the children.
 
Methods inherited from class com.sun.tools.txw2.model.Leaf
createDataMethod, getNext, getPrev, merge, siblings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

leaf

public Leaf leaf
Children of this node.

Constructor Detail

Node

protected Node(Locator location,
               Leaf leaf)
Method Detail

iterator

public final Iterator<Leaf> iterator()
Iterates all the children.

Specified by:
iterator in interface 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.



Copyright © 2012 Oracle. All Rights Reserved.