org.eclipse.xtext.nodemodel
Interface BidiTreeIterator<T>

All Superinterfaces:
BidiIterator<T>, java.util.Iterator<T>, org.eclipse.emf.common.util.TreeIterator<T>
All Known Implementing Classes:
BasicNodeTreeIterator, NodeTreeIterator, ReversedBidiTreeIterator

public interface BidiTreeIterator<T>
extends org.eclipse.emf.common.util.TreeIterator<T>, BidiIterator<T>

A bidirectional tree iterator. It can be used in both directions and even alternating.

Author:
Sebastian Zarnekow - Initial contribution and API

Method Summary
 T next()
          
 T previous()
          Returns the previous element.
 
Methods inherited from interface org.eclipse.emf.common.util.TreeIterator
prune
 
Methods inherited from interface java.util.Iterator
hasNext, remove
 
Methods inherited from interface org.eclipse.xtext.nodemodel.BidiIterator
hasPrevious
 
Methods inherited from interface java.util.Iterator
hasNext, remove
 

Method Detail

next

T next()

Intermixed calls to next() and previous() may not lead to the very same element since the iterator does not return the parent element when its done with its children but the next sibling of the parent.

Specified by:
next in interface java.util.Iterator<T>
Throws:
java.util.NoSuchElementException - iteration has no next element.

previous

T previous()
Returns the previous element. This method may be called repeatedly to iterate backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)

Intermixed calls to next() and previous() may not lead to the very same element since the iterator does not return the parent element when its done with its children but the next sibling of the parent.

Specified by:
previous in interface BidiIterator<T>
Returns:
the previous element.
Throws:
java.util.NoSuchElementException - iteration has no previous element.