T
- element typepublic class BoundedIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>
Constructor and Description |
---|
BoundedIterator(long offset,
long max,
java.util.Iterator<T> iterator)
Create a new bounded iterator with a given offset and maximum
|
Modifier and Type | Method and Description |
---|---|
static <T> java.util.Iterator<T> |
create(long offset,
long max,
java.util.Iterator<T> iterator)
Factory for creating a bounded iterator.
|
boolean |
hasNext() |
T |
next() |
void |
remove() |
public BoundedIterator(long offset, long max, java.util.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 iteratorjava.lang.IllegalArgumentException
- if offset is negativepublic static <T> java.util.Iterator<T> create(long offset, long max, java.util.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)
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
public void remove()
remove
in interface java.util.Iterator<T>
Copyright © 2010 - 2020 Adobe. All Rights Reserved