X
- Type of itempublic final class Filtered<X> extends Object implements Iterator<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":
Iterator<String> list = new Filtered<>( new ArrayOf<>( "hey", "hello", "world" ).iterator(), input -> input.length() > 4 );
There is no thread-safety guarantee.
Filtered
Constructor and Description |
---|
Filtered(Func<X,Boolean> fnc,
Iterator<X> src)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
X |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
Copyright © 2017–2018 Cactoos. All rights reserved.