Class FilterSpliterator<T>

java.lang.Object
org.infinispan.commons.util.FilterSpliterator<T>
All Implemented Interfaces:
AutoCloseable, Spliterator<T>, CloseableSpliterator<T>

public class FilterSpliterator<T> extends Object implements CloseableSpliterator<T>
Spliterator that only returns entries that pass the given predicate. This spliterator will inherit all of the characteristics of the underlying spliterator, except that it won't return 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.

Since:
9.3
Author:
wburns