Constructor and Description |
---|
BoundedIterator(long offset,
long max,
Iterator<T> iterator)
Create a new bounded iterator with a given offset and maximum
|
Modifier and Type | Method and Description |
---|---|
static <T> Iterator<T> |
create(long offset,
long max,
Iterator<T> iterator)
Factory for creating a bounded iterator.
|
boolean |
hasNext() |
T |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public BoundedIterator(long offset, long max, Iterator<T> iterator)
offset
- offset to start iteration at. Must be non negativemax
- maximum elements this iterator should return. Set to -1 for alliterator
- the underlying iteratorIllegalArgumentException
- if offset is negativepublic static <T> Iterator<T> create(long offset, long max, Iterator<T> iterator)
T
- element typeoffset
- offset to start iteration at. Must be non negativemax
- maximum elements this iterator should return. Set to -1 for alliterator
- the underlying iteratorBoundedIterator(long, long, java.util.Iterator)
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.