![JAR search and dependency download from the Maven repository](/logo.png)
javadoc.com.google.common.collect.PeekingIterator.html Maven / Gradle / Ivy
The newest version!
PeekingIterator (Guava: Google Core Libraries for Java 11.0.1 API)
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
com.google.common.collect
Interface PeekingIterator<E>
- All Superinterfaces:
- Iterator<E>
@GwtCompatible
public interface PeekingIterator<E>
- extends Iterator<E>
An iterator that supports a one-element lookahead while iterating.
- Since:
- 2.0 (imported from Google Collections Library)
- Author:
- Mick Killianey
Method Summary | |
---|---|
E |
next()
|
E |
peek()
Returns the next element in the iteration, without advancing the iteration. |
void |
remove()
|
Methods inherited from interface java.util.Iterator |
---|
hasNext |
Method Detail |
---|
peek
E peek()
- Returns the next element in the iteration, without advancing the iteration.
Calls to
peek()
should not change the state of the iteration, except that it may prevent removal of the most recent element viaremove()
.- Throws:
NoSuchElementException
- if the iteration has no more elements according toIterator.hasNext()
next
E next()
-
The objects returned by consecutive calls to
peek()
thennext()
are guaranteed to be equal to each other.
remove
void remove()
-
Implementations may or may not support removal when a call to
peek()
has occurred since the most recent call tonext()
.- Throws:
IllegalStateException
- if there has been a call topeek()
since the most recent call tonext()
and this implementation does not support this sequence of calls (optional)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010-2012. All Rights Reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy