Package org.eclipse.xtext.nodemodel.util
Class ReversedBidiIterator<T>
- java.lang.Object
-
- org.eclipse.xtext.nodemodel.util.ReversedBidiIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
,BidiIterator<T>
- Direct Known Subclasses:
ReversedBidiTreeIterator
public class ReversedBidiIterator<T> extends java.lang.Object implements BidiIterator<T>
-
-
Constructor Summary
Constructors Constructor Description ReversedBidiIterator(BidiIterator<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BidiIterator<T>
getDelegate()
boolean
hasNext()
boolean
hasPrevious()
Returns true if this bidi iterator has more elements when traversing in the reverse direction.T
next()
T
previous()
Returns the previous element.void
remove()
-
-
-
Constructor Detail
-
ReversedBidiIterator
public ReversedBidiIterator(BidiIterator<T> delegate)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<T>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<T>
-
hasPrevious
public boolean hasPrevious()
Description copied from interface:BidiIterator
Returns true if this bidi iterator has more elements when traversing in the reverse direction. (In other words, returns true if previous would return an element rather than throwing an exception.)- Specified by:
hasPrevious
in interfaceBidiIterator<T>
- Returns:
- true if the bidi iterator has more elements when traversing in the reverse direction.
-
previous
public T previous()
Description copied from interface:BidiIterator
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.)- Specified by:
previous
in interfaceBidiIterator<T>
- Returns:
- the previous element.
-
getDelegate
protected BidiIterator<T> getDelegate()
-
-