public class FilterSpliterator<T> extends Object implements CloseableSpliterator<T>
Spliterator.SIZED or
Spliterator.SUBSIZED.
The forEachRemaining(Consumer) method should provide better performance than calling
tryAdvance(Consumer) until it returns false. This is due to having to capture the argument before testing
it and finally invoking the provided Consumer.
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS,T_SPLITR extends Spliterator.OfPrimitive<T,T_CONS,T_SPLITR>>CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED| Constructor and Description |
|---|
FilterSpliterator(Spliterator<T> spliterator,
Predicate<? super T> predicate) |
| Modifier and Type | Method and Description |
|---|---|
int |
characteristics() |
void |
close() |
long |
estimateSize() |
void |
forEachRemaining(Consumer<? super T> action) |
boolean |
tryAdvance(Consumer<? super T> action) |
Spliterator<T> |
trySplit() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetComparator, getExactSizeIfKnown, hasCharacteristicspublic FilterSpliterator(Spliterator<T> spliterator, Predicate<? super T> predicate)
public void close()
close in interface AutoCloseableclose in interface CloseableSpliterator<T>public boolean tryAdvance(Consumer<? super T> action)
tryAdvance in interface Spliterator<T>public void forEachRemaining(Consumer<? super T> action)
forEachRemaining in interface Spliterator<T>public Spliterator<T> trySplit()
trySplit in interface Spliterator<T>public long estimateSize()
estimateSize in interface Spliterator<T>public int characteristics()
characteristics in interface Spliterator<T>Copyright © 2020 JBoss, a division of Red Hat. All rights reserved.