Package eu.bandm.tools.util.java
Class Iterators.MultipleLookaheadIterator<T>
java.lang.Object
eu.bandm.tools.util.java.Iterators.MultipleLookaheadIterator<T>
- All Implemented Interfaces:
Iterator<T>
- Enclosing class:
- Iterators
An iterator which allows arbitrary deep look-ahead for an underlying iterator.
-
Constructor Summary
ConstructorDescriptionMultipleLookaheadIterator
(Iterable<? extends T> things) Constructor which sets the underlying iterator.MultipleLookaheadIterator
(Iterator<? extends T> it) MultipleLookaheadIterator
(T... things) Constructor which iterates over the given things. -
Method Summary
Modifier and TypeMethodDescriptionboolean
hasNext()
boolean
hasNext
(int index) Returns whether the next (index+1) calls tohasNext()
will be successful.lookahead
(int index) Returns the object delivered by the last of (index+1) calls ofnext()
, as defined with the original iterator.next()
void
remove()
Unsupported OperationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
MultipleLookaheadIterator
Constructor which sets the underlying iterator. -
MultipleLookaheadIterator
Constructor which iterates over the given things. -
MultipleLookaheadIterator
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()Unsupported Operation -
hasNext
public boolean hasNext(int index) Returns whether the next (index+1) calls tohasNext()
will be successful. -
lookahead
Returns the object delivered by the last of (index+1) calls ofnext()
, as defined with the original iterator.
-