T - Type of iterated elementpublic class LazyMatchingTypeIterator<T> extends Object implements Iterator<T>
Iterator that selects only objects of a certain type from
the underlying available ones. The "lazy" denomination is due
to the fact that selection occurs only when hasNext() is called| Modifier and Type | Field and Description |
|---|---|
protected boolean |
finished |
protected T |
nextValue |
| Constructor and Description |
|---|
LazyMatchingTypeIterator(Iterator<?> values,
Class<T> type) |
| Modifier and Type | Method and Description |
|---|---|
Class<T> |
getType() |
Iterator<?> |
getValues() |
boolean |
hasNext() |
static <T> Iterator<T> |
lazySelectMatchingTypes(Iterator<?> values,
Class<T> type) |
T |
next() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachRemaining, removeprotected boolean finished
protected T nextValue
public Iterator<?> getValues()
public static <T> Iterator<T> lazySelectMatchingTypes(Iterator<?> values, Class<T> type)
T - Type if iterated elementvalues - The source values - ignored if nulltype - The (never @code null) type of values to select - any value
whose type is assignable to this type will be selected by the iterator.Iterator whose next() call selects only values
matching the specific type. Note: the matching values are not
pre-calculated (hence the "lazy" denomination) - i.e.,
the match is performed only when Iterator.hasNext() is called.Copyright © 2018–2020 The Apache Software Foundation. All rights reserved.