T
- Type of element being selectedpublic class LazyMatchingTypeIterable<T> extends Object implements Iterable<T>
Iterable
over values that match a
specific type out of all available. The "lazy" denomination
is due to the fact that the next matching value is calculated on-the-fly
every time Iterator.hasNext()
is calledConstructor and Description |
---|
LazyMatchingTypeIterable(Iterable<?> values,
Class<T> type) |
Modifier and Type | Method and Description |
---|---|
Class<T> |
getType() |
Iterable<?> |
getValues() |
Iterator<T> |
iterator() |
static <T> Iterable<T> |
lazySelectMatchingTypes(Iterable<?> values,
Class<T> type) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Iterable<?> getValues()
public static <T> Iterable<T> lazySelectMatchingTypes(Iterable<?> values, Class<T> type)
T
- Type if iterated elementvalues
- The source values - ignored if null
type
- The (never @code null) type of values to select - any value
whose type is assignable to this type will be selected by the iterator.Iterable
whose Iterator
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 © 2008–2022 The Apache Software Foundation. All rights reserved.