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, wait
getComparator, getExactSizeIfKnown, hasCharacteristics
public FilterSpliterator(Spliterator<T> spliterator, Predicate<? super T> predicate)
public void close()
close
in interface AutoCloseable
close
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 © 2021 JBoss by Red Hat. All rights reserved.