Package org.codehaus.groovy.util
Class IteratorBufferedIterator<T>
java.lang.Object
org.codehaus.groovy.util.IteratorBufferedIterator<T>
- All Implemented Interfaces:
BufferedIterator<T>,Iterator<T>
An implementation for BufferedIterator wraps Iterator.
- Since:
- 2.5.0
-
Constructor Summary
ConstructorsConstructorDescriptionIteratorBufferedIterator(Iterator<T> iter) Creates a buffered iterator that can peek into the supplied iterator. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
IteratorBufferedIterator
Creates a buffered iterator that can peek into the supplied iterator.- Parameters:
iter- the iterator to wrap
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
head
Returns the next element without advancing the iterator.- Specified by:
headin interfaceBufferedIterator<T>- Returns:
- the next element
-