Module org.tquadrat.foundation.base
Class ZippingSpliterator<L,R,O>  
java.lang.Object
org.tquadrat.foundation.stream.internal.ZippingSpliterator<L,R,O>  
- Type Parameters:
- L- The type over which the "left" stream is streaming.
- R- The type over which the "right" stream is streaming.
- O- The type created by the combiner out of pairs of "left" and "right" values, over which the resulting stream streams.
- All Implemented Interfaces:
- Spliterator<O>
@ClassVersion(sourceVersion="$Id: ZippingSpliterator.java 1060 2023-09-24 19:21:40Z tquadrat $")
@API(status=INTERNAL,
     since="0.0.7")
public final class ZippingSpliterator<L,R,O>  
extends Object
implements Spliterator<O>
An implementation of
  
Spliterator
  that zips two streams into one.- Author:
- Dominic Fox
- Modified by:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: ZippingSpliterator.java 1060 2023-09-24 19:21:40Z tquadrat $
- Since:
- 0.0.7
- UML Diagram
- 
    
         UML Diagram for "org.tquadrat.foundation.stream.internal.ZippingSpliterator" 
- 
Nested Class SummaryNested classes/interfaces inherited from interface java.util.SpliteratorSpliterator.OfDouble, Spliterator.OfInt, Spliterator.OfLong, Spliterator.OfPrimitive<T,T_CONS, T_SPLITR extends Spliterator.OfPrimitive<T, T_CONS, T_SPLITR>> 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final BiFunction<L, R, O> The combiner function.private final Spliterator<L> The left-hand source.private booleanFlag the indicates whether the right-hand source has the next value.private final Spliterator<R> The right-hand source.Fields inherited from interface java.util.SpliteratorCONCURRENT, DISTINCT, IMMUTABLE, NONNULL, ORDERED, SIZED, SORTED, SUBSIZED
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprivateZippingSpliterator(Spliterator<L> lefts, Spliterator<R> rights, BiFunction<L, R, O> combiner) Creates a newZippingSpliteratorinstance.
- 
Method SummaryModifier and TypeMethodDescriptionfinal intfinal longfinal booleantryAdvance(Consumer<? super O> action) final Spliterator<O> trySplit()static final <L,R, O> Spliterator <O> zipping(Spliterator<L> lefts, Spliterator<R> rights, BiFunction<L, R, O> combiner) Factory for instances ofZippingSpliterator.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.SpliteratorforEachRemaining, getComparator, getExactSizeIfKnown, hasCharacteristics
- 
Field Details- 
m_CombinerThe combiner function.
- 
m_LeftsThe left-hand source.
- 
m_RightHadNextFlag the indicates whether the right-hand source has the next value.
- 
m_RightsThe right-hand source.
 
- 
- 
Constructor Details- 
ZippingSpliteratorCreates a newZippingSpliteratorinstance.- Parameters:
- lefts- The left-hand source.
- rights- The right-hand source.
- combiner- The combiner.
 
 
- 
- 
Method Details- 
characteristics- Specified by:
- characteristicsin interface- Spliterator<L>
 
- 
estimateSize- Specified by:
- estimateSizein interface- Spliterator<L>
 
- 
tryAdvance- Specified by:
- tryAdvancein interface- Spliterator<L>
 
- 
trySplit- Specified by:
- trySplitin interface- Spliterator<L>
 
- 
zippingpublic static final <L,R, Spliterator<O> zippingO> (Spliterator<L> lefts, Spliterator<R> rights, BiFunction<L, R, O> combiner) Factory for instances ofZippingSpliterator.- Type Parameters:
- L- The type over which the "left" stream is streaming.
- R- The type over which the "right" stream is streaming.
- O- The type created by the combiner out of pairs of "left" and "right" values, over which the resulting stream streams.
- Parameters:
- lefts- The left-hand source.
- rights- The right-hand source.
- combiner- The combiner.
- Returns:
- The new instance.
 
 
- 
