X
- Type of itempublic final class Filtered<X> extends IterableEnvelope<X>
You can use it in order to create a declarative/lazy version of a filtered collection/iterable. For example, this code will create a list of two strings "hello" and "world":
Iterable<String> list = new Filtered<>( new ArrayOf<>( "hey", "hello", "world" ), input -> input.length() > 4 );
There is no thread-safety guarantee.
Filtered
Constructor and Description |
---|
Filtered(Func<? super X,Boolean> fnc,
Iterable<? extends X> src)
Ctor.
|
Filtered(Func<? super X,Boolean> fnc,
X... src)
Ctor.
|
Filtered(Iterable<? extends X> src,
Func<? super X,Scalar<Boolean>> fnc)
Ctor.
|
equals, hashCode, iterator, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
@SafeVarargs public Filtered(Func<? super X,Boolean> fnc, X... src)
fnc
- Predicatesrc
- Source iterablepublic Filtered(Func<? super X,Boolean> fnc, Iterable<? extends X> src)
fnc
- Predicatesrc
- Source iterableCopyright © 2017–2020 Cactoos. All rights reserved.