Package io.permazen.util
Class ConvertedSpliterator<E,W>
java.lang.Object
io.permazen.util.ConvertedSpliterator<E,W>
- Type Parameters:
E
- element type of this instanceW
- element type of the wrapped instance
- All Implemented Interfaces:
Spliterator<E>
Provides a transformed view of a wrapped
ConvertedSpliterator
using a strictly invertable Converter
.-
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 inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
-
Constructor Summary
ConstructorDescriptionConvertedSpliterator
(Spliterator<W> inner, Converter<W, E> converter) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
long
void
forEachRemaining
(Consumer<? super E> consumer) Get theConverter
associated with this instance.long
Get the wrappedSpliterator
.boolean
hasCharacteristics
(int characteristics) int
hashCode()
boolean
tryAdvance
(Consumer<? super E> action) trySplit()
-
Constructor Details
-
ConvertedSpliterator
Constructor.- Parameters:
inner
- wrapped instanceconverter
- element converter- Throws:
IllegalArgumentException
- if either parameter is null
-
-
Method Details
-
getWrappedSpliterator
Get the wrappedSpliterator
.- Returns:
- the wrapped
Spliterator
.
-
getConverter
Get theConverter
associated with this instance.- Returns:
- associated
Converter
-
characteristics
public int characteristics()- Specified by:
characteristics
in interfaceSpliterator<E>
-
estimateSize
public long estimateSize()- Specified by:
estimateSize
in interfaceSpliterator<E>
-
forEachRemaining
- Specified by:
forEachRemaining
in interfaceSpliterator<E>
-
getComparator
- Specified by:
getComparator
in interfaceSpliterator<E>
-
getExactSizeIfKnown
public long getExactSizeIfKnown()- Specified by:
getExactSizeIfKnown
in interfaceSpliterator<E>
-
hasCharacteristics
public boolean hasCharacteristics(int characteristics) - Specified by:
hasCharacteristics
in interfaceSpliterator<E>
-
tryAdvance
- Specified by:
tryAdvance
in interfaceSpliterator<E>
-
trySplit
- Specified by:
trySplit
in interfaceSpliterator<E>
-
equals
-
hashCode
public int hashCode()
-