Module org.tquadrat.foundation.base
Class AggregatingSpliterator<I>
java.lang.Object
org.tquadrat.foundation.stream.internal.AggregatingSpliterator<I>
- Type Parameters:
I- The type of the stream elements.
- All Implemented Interfaces:
Spliterator<List<I>>
@ClassVersion(sourceVersion="$Id: AggregatingSpliterator.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=INTERNAL,
since="0.0.7")
public class AggregatingSpliterator<I>
extends Object
implements Spliterator<List<I>>
An implementation of
Spliterator
that aggregates the elements of the stream based on a provided
Predicate.- Author:
- Dominic Fox
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: AggregatingSpliterator.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.7
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.stream.internal.AggregatingSpliterator"
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.Spliterator
Spliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BiPredicate<List<I>, I> The predicate.The current slide.private final Spliterator<I> The source.Fields inherited from interface java.util.Spliterator
CONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED -
Constructor Summary
ConstructorsConstructorDescriptionAggregatingSpliterator(Spliterator<I> source, BiPredicate<List<I>, I> predicate) Creates a newAggregatingSpliteratorinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal longprivate booleanisSameSlide(I currentElement) Checks whether the current element is on the current slide.final booleantryAdvance(Consumer<? super List<I>> action) final Spliterator<List<I>> 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
forEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
-
Field Details
-
m_Condition
The predicate. -
m_CurrentSlide
The current slide. -
m_Source
The source.
-
-
Constructor Details
-
AggregatingSpliterator
Creates a newAggregatingSpliteratorinstance.- Parameters:
source- The source.predicate- The predicate.
-
-
Method Details
-
characteristics
- Specified by:
characteristicsin interfaceSpliterator<I>
-
estimateSize
- Specified by:
estimateSizein interfaceSpliterator<I>
-
isSameSlide
Checks whether the current element is on the current slide.- Parameters:
currentElement- The current element.- Returns:
trueif the current element is on the current slide.
-
tryAdvance
- Specified by:
tryAdvancein interfaceSpliterator<I>
-
trySplit
- Specified by:
trySplitin interfaceSpliterator<I>
-
