Package org.infinispan.commons.util
Class SpliteratorMapper<E,S>
java.lang.Object
org.infinispan.commons.util.SpliteratorMapper<E,S>
- All Implemented Interfaces:
AutoCloseable,Spliterator<S>,CloseableSpliterator<S>
A spliterator that has been mapped from another spliterator. This is nice to only lazily convert these values, so
that you can convert across multiple threads or if the entire spliterator is not consumed.
This spliterator will always throw an IllegalStateException upon invocation of
Spliterator.getComparator() since there is no trivial way of converting this with a mapper.
- Since:
- 9.0
- Author:
- wburns
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T extends Object,T_CONS extends Object, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
FieldsFields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsConstructorDescriptionSpliteratorMapper(Spliterator<E> spliterator, Function<? super E, ? extends S> mapper) -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()longvoidforEachRemaining(Consumer<? super S> action) longbooleanhasCharacteristics(int characteristics) booleantryAdvance(Consumer<? super S> action) trySplit()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Spliterator
getComparator
-
Field Details
-
spliterator
-
mapper
-
-
Constructor Details
-
SpliteratorMapper
-
-
Method Details
-
tryAdvance
- Specified by:
tryAdvancein interfaceSpliterator<E>
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<E>
-
estimateSize
public long estimateSize()- Specified by:
estimateSizein interfaceSpliterator<E>
-
characteristics
public int characteristics()- Specified by:
characteristicsin interfaceSpliterator<E>
-
forEachRemaining
- Specified by:
forEachRemainingin interfaceSpliterator<E>
-
getExactSizeIfKnown
public long getExactSizeIfKnown()- Specified by:
getExactSizeIfKnownin interfaceSpliterator<E>
-
hasCharacteristics
public boolean hasCharacteristics(int characteristics) - Specified by:
hasCharacteristicsin interfaceSpliterator<E>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableSpliterator<E>
-