org.antlr.runtime.tree
Class TreeIterator

java.lang.Object
  extended by org.antlr.runtime.tree.TreeIterator
All Implemented Interfaces:
Iterator

public class TreeIterator
extends Object
implements Iterator

Return a node stream from a doubly-linked tree whose nodes know what child index they are. No remove() is supported. Emit navigation nodes (DOWN, UP, and EOF) to let show tree structure.


Field Summary
protected  TreeAdaptor adaptor
           
 Object down
           
 Object eof
           
protected  boolean firstTime
           
protected  FastQueue nodes
          If we emit UP/DOWN nodes, we need to spit out multiple nodes per next() call.
protected  Object root
           
protected  Object tree
           
 Object up
           
 
Constructor Summary
TreeIterator(Object tree)
           
TreeIterator(TreeAdaptor adaptor, Object tree)
           
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 void remove()
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adaptor

protected TreeAdaptor adaptor

root

protected Object root

tree

protected Object tree

firstTime

protected boolean firstTime

up

public Object up

down

public Object down

eof

public Object eof

nodes

protected FastQueue nodes
If we emit UP/DOWN nodes, we need to spit out multiple nodes per next() call.

Constructor Detail

TreeIterator

public TreeIterator(Object tree)

TreeIterator

public TreeIterator(TreeAdaptor adaptor,
                    Object tree)
Method Detail

reset

public void reset()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator


Copyright © 2011. All Rights Reserved.