java.lang.Object
org.apache.jena.atlas.iterator.PeekIterator<T>
- All Implemented Interfaces:
Iterator<T>
PeekIterator - it is one slot ahead reading from the wrapped iterator.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> PeekIterator<T>static <T> PeekIterator<T>create(PeekIterator<T> iter) element()Peek the next element or throw NoSuchElementExceptionbooleanhasNext()next()peek()Peek the next element or return null This code predatesOptional.booleanReturn whether the peek'ed element exists of not.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
PeekIterator
-
-
Method Details
-
create
-
create
-
hasNext
public boolean hasNext() -
peek
Peek the next element or return null This code predatesOptional. See "slotIsValid()" to check if a null is end-of-iterator or a valid return element. -
slotIsValid
public boolean slotIsValid()Return whether the peek'ed element exists of not. When the underlying iterator may yield null as a valid value of "next", use this to determine the status of the "peek()". This code predatesOptional. -
element
Peek the next element or throw NoSuchElementException -
next
-