public class FilteredRangeIterator
extends java.lang.Object
| Constructor and Description |
|---|
FilteredRangeIterator(java.util.Iterator<?> iterator)
Creates a pre-fetching decorator for the given iterator.
|
FilteredRangeIterator(java.util.Iterator<?> iterator,
Predicate predicate)
Creates a new filtered iterator with the default pre-fetch buffer size.
|
FilteredRangeIterator(java.util.Iterator<?> iterator,
Predicate predicate,
int bufferSize)
Creates a new filtered iterator.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getPosition()
Returns the zero-based position of the next element in this iterator.
|
long |
getSize()
Returns the total number of elements in this iterator, or -1 if that
number is unknown.
|
boolean |
hasNext()
Checks whether there are more elements in this iterator.
|
java.lang.Object |
next()
Returns the next element in this iterator.
|
void |
remove()
Not supported.
|
void |
skip(long n)
Skips the next n elements.
|
public FilteredRangeIterator(java.util.Iterator<?> iterator,
Predicate predicate,
int bufferSize)
iterator - underlying iteratorpredicate - bufferSize - public FilteredRangeIterator(java.util.Iterator<?> iterator,
Predicate predicate)
iterator - underlying iteratorpredicate - predicate used for filteringpublic FilteredRangeIterator(java.util.Iterator<?> iterator)
iterator - underlying iteratorpublic long getPosition()
public long getSize()
public void skip(long n)
throws java.lang.IllegalArgumentException,
java.util.NoSuchElementException
n - number of elements to skipjava.lang.IllegalArgumentException - if n is negativejava.util.NoSuchElementException - if there are not enough elements to skippublic boolean hasNext()
true if there are more elements,
false otherwisepublic java.lang.Object next()
throws java.util.NoSuchElementException
java.util.NoSuchElementException - if there are no more elementspublic void remove()
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"