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>
- Direct Known Subclasses:
 CloseableSpliteratorMapper
public class SpliteratorMapper<E,S> extends Object implements 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
IllegalStateExceptionupon invocation ofSpliterator.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
Fields Modifier and Type Field Description protected Function<? super E,? extends S>mapperprotected Spliterator<E>spliterator- 
Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED 
 - 
 
- 
Constructor Summary
Constructors Constructor Description SpliteratorMapper(Spliterator<E> spliterator, Function<? super E,? extends S> mapper) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcharacteristics()voidclose()longestimateSize()voidforEachRemaining(Consumer<? super S> action)longgetExactSizeIfKnown()booleanhasCharacteristics(int characteristics)booleantryAdvance(Consumer<? super S> action)Spliterator<S>trySplit()- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface java.util.Spliterator
getComparator 
 - 
 
 - 
 
- 
- 
Field Detail
- 
spliterator
protected final Spliterator<E> spliterator
 
 - 
 
- 
Constructor Detail
- 
SpliteratorMapper
public SpliteratorMapper(Spliterator<E> spliterator, Function<? super E,? extends S> mapper)
 
 - 
 
- 
Method Detail
- 
tryAdvance
public boolean tryAdvance(Consumer<? super S> action)
- Specified by:
 tryAdvancein interfaceSpliterator<E>
 
- 
trySplit
public Spliterator<S> 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
public void forEachRemaining(Consumer<? super S> action)
- 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>
 
 - 
 
 -