public class MarkResetSkippingIterator<T> extends AbstractSkippingIterator<T> implements MarkResetIterator<T>
mark-reset behavior
via ResettableIterator.reset()
and SkippingIterator.skipTo(Object)
.
Note: this class does not CloseableIterator.close()
the argument iterator.CloseableIterator.AbstractCloseableIterator<T>, CloseableIterator.DelegatingCloseableIterator<T>, CloseableIterator.EmptyCloseableIterator<T>
mComparator
UNKNOWN_SIZE
Constructor and Description |
---|
MarkResetSkippingIterator(SkippingIterator<T> theIterator) |
Modifier and Type | Method and Description |
---|---|
protected T |
computeNext()
Return the next element to be returned by the iterator
|
protected T |
computeSkipTo(T theTarget)
Returns the element that this iteration has skipped to or
null if
it ran off the end. |
MarkResetSkippingIterator<T> |
copy()
Create a deep copy of the object which does not share any references with the original.
|
void |
mark(T element)
Creates a mark from the provided element.
|
protected void |
performReset() |
void |
resetToMark()
Rewinds the position of the iterator to the previously marked element.
|
assertOpen, close, comparator, computeSkipTo, endOfData, estimatedSize, hasNext, isClosed, isLessOrEqualThan, next, peek, remove, reset, resetState, skipTo, skipTo, validateSkipTarget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
empty
reset
close, closeQuietly, collect, concat, concat, concat, filter, first, isEmpty, limit, map, offset, onClose, singleton, size, toCloseable, toCloseable, toCloseable, toList, toSet, transform
forEachRemaining, hasNext, next, remove
public MarkResetSkippingIterator(SkippingIterator<T> theIterator)
protected T computeNext()
AbstractSkippingIterator
computeNext
in class AbstractSkippingIterator<T>
protected T computeSkipTo(T theTarget)
AbstractSkippingIterator
null
if
it ran off the end.computeSkipTo
in class AbstractSkippingIterator<T>
theTarget
- the skipping targetnull
if it doesn't exist.protected void performReset()
performReset
in class AbstractSkippingIterator<T>
public void mark(T element)
MarkResetIterator
mark
in interface MarkResetIterator<T>
element
- the element to serve as a markpublic void resetToMark()
MarkResetIterator
resetToMark
in interface MarkResetIterator<T>
public MarkResetSkippingIterator<T> copy()
Copyable
copy
in interface Copyable<MarkResetIterator<T>>
Copyright © 2010-2016 Stardog Union. All Rights Reserved.