org.eclipse.xtext.parsetree.reconstr.impl
Class NodeIterator

java.lang.Object
  extended by org.eclipse.xtext.parsetree.reconstr.impl.NodeIterator
All Implemented Interfaces:
java.util.Iterator<INode>, org.eclipse.emf.common.util.TreeIterator<INode>

public class NodeIterator
extends java.lang.Object
implements org.eclipse.emf.common.util.TreeIterator<INode>

An iterator that can traverse a parse tree in forward and backward direction starting from any element in the tree. Also allows pruning of nodes.

Author:
Jan Koehnlein - Initial contribution and API

Constructor Summary
NodeIterator(INode node)
           
 
Method Summary
protected  INode findNextSibling(INode node)
           
 boolean hasNext()
           
 boolean hasPrevious()
           
 INode next()
           
 INode previous()
           
 void prune()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeIterator

public NodeIterator(INode node)
Method Detail

findNextSibling

protected INode findNextSibling(INode node)

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<INode>

next

public INode next()
Specified by:
next in interface java.util.Iterator<INode>

hasPrevious

public boolean hasPrevious()

previous

public INode previous()

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<INode>

prune

public void prune()
Specified by:
prune in interface org.eclipse.emf.common.util.TreeIterator<INode>