Package org.apache.jena.atlas.iterator
Class PeekIterator<T>
- java.lang.Object
-
- org.apache.jena.atlas.iterator.PeekIterator<T>
-
- All Implemented Interfaces:
java.util.Iterator<T>
public class PeekIterator<T> extends java.lang.Object implements java.util.Iterator<T>PeekIterator - is one slot ahead from the wrapped iterator
-
-
Constructor Summary
Constructors Constructor Description PeekIterator(java.util.Iterator<T> iter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> PeekIterator<T>create(java.util.Iterator<T> iter)static <T> PeekIterator<T>create(PeekIterator<T> iter)Telement()Peek the next element or throw NoSuchElementExceptionbooleanhasNext()Tnext()Tpeek()Peek the next element or return null
-
-
-
Constructor Detail
-
PeekIterator
public PeekIterator(java.util.Iterator<T> iter)
-
-
Method Detail
-
create
public static <T> PeekIterator<T> create(PeekIterator<T> iter)
-
create
public static <T> PeekIterator<T> create(java.util.Iterator<T> iter)
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<T>
-
peek
public T peek()
Peek the next element or return null- See Also:
Queue.peek()
-
element
public T element()
Peek the next element or throw NoSuchElementException
-
-