|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.functor.core.collection.FilteredIterable<T>
T - public class FilteredIterable<T>
Adds a fluent filtering API to any Iterable.
| Method Summary | ||
|---|---|---|
static
|
empty()
Get an empty FilteredIterable. |
|
Iterator<T> |
iterator()
|
|
static
|
of(Iterable<T> iterable)
Get a FilteredIterable of iterable. |
|
FilteredIterable<T> |
retain(Class<?>... ofType)
Retain elements of any of specified types. |
|
|
retain(Class<U> type)
Retain elements of a given type with type-safety. |
|
FilteredIterable<T> |
retain(UnaryPredicate<? super T> predicate)
Retain only elements matching predicate. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public Iterator<T> iterator()
iterator in interface Iterable<T>public String toString()
toString in class Objectpublic FilteredIterable<T> retain(UnaryPredicate<? super T> predicate)
predicate.
predicate - filter, non-null
this, fluentlypublic <U> FilteredIterable<U> retain(Class<U> type)
U - type - filter, non-null
thispublic FilteredIterable<T> retain(Class<?>... ofType)
ofType - filter, non-null
this, fluentlypublic static <T> FilteredIterable<T> of(Iterable<T> iterable)
FilteredIterable of iterable. If wrapped is null,
result will also be null. A FilteredIterable argument will be passed back
directly; any other argument will be wrapped in a new FilteredIterable object.
T - iterable - wrapped
public static <T> FilteredIterable<T> empty()
T -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||