Package generic.util
Class AbstractPeekableIterator<T>
java.lang.Object
generic.util.AbstractPeekableIterator<T>
- Type Parameters:
T- the type of elements
- All Implemented Interfaces:
PeekableIterator<T>,Iterator<T>
- Direct Known Subclasses:
CachedAddressSetView.CachedRangeIterator,DBTraceProgramViewSymbolTable.PrimarySymbolIterator,DistinctIterator,OverlappingObjectIterator,TraceViewportSpanIterator,TwoWayBreakdownAddressRangeIterator,UnionAddressRangeIterator,WrappingPeekableIterator
An implementation of
PeekableIterator that only requires a way to seek out the next
element. This will keep that element in hand until the next element is actually requested by the
client. This does not invoke the search until the next element is required, either because the
client called next or else wants to peek at it.-
Field Details
-
next
-
soughtNext
protected boolean soughtNext
-
-
Constructor Details
-
AbstractPeekableIterator
public AbstractPeekableIterator()
-
-
Method Details
-
seekNext
- Returns:
- the next element
-
hasNext
public boolean hasNext() -
next
-
peek
Description copied from interface:PeekableIteratorReturns the item that would be returned by callingIterator.next(), but without incrementing the iterator.- Specified by:
peekin interfacePeekableIterator<T>- Returns:
- the item that would be returned by calling
Iterator.next() - Throws:
NoSuchElementException- if there is no element to peek at
-