com.sun.tools.txw2.model
Class Node
java.lang.Object
com.sun.tools.txw2.model.Leaf
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
leaf
public Leaf leaf
- Children of this node.
Node
protected Node(Locator location,
Leaf leaf)
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 © 2013 Oracle. All Rights Reserved.