Class PairSpliterator.PSOfRef<T,​R>

    • Constructor Summary

      Constructors 
      Constructor Description
      PSOfRef​(java.util.function.BiFunction<? super T,​? super T,​? extends R> mapper, java.util.Spliterator<T> source)  
      PSOfRef​(java.util.function.Function<? super T,​? extends R> boundMapper, java.util.function.Function<? super T,​? extends R> elseMapper, java.util.Spliterator<T> source, boolean first)  
      PSOfRef​(java.util.function.Function<? super T,​? extends R> mapper, java.util.Spliterator<T> source, boolean first)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(T t)  
      private java.util.function.BiConsumer<T,​T> fn​(java.util.function.Consumer<? super R> action)  
      java.util.Spliterator<R> forEachOrTail​(java.util.function.Consumer<? super R> action)
      Traverses this spliterator and returns null if traversal is completed or tail spliterator if it must be used for further traversal.
      void forEachRemaining​(java.util.function.Consumer<? super R> action)  
      boolean tryAdvance​(java.util.function.Consumer<? super R> action)  
      java.util.Spliterator<R> tryAdvanceOrTail​(java.util.function.Consumer<? super R> action)
      Either advances by one element feeding it to consumer and returns this or returns tail spliterator (this spliterator becomes invalid and tail must be used instead) or returns null if traversal finished.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Consumer

        andThen
      • Methods inherited from interface java.util.Spliterator

        characteristics, estimateSize, getComparator, getExactSizeIfKnown, hasCharacteristics, trySplit
    • Field Detail

      • HEAD_TAIL

        private static final java.lang.Object HEAD_TAIL
      • mapper

        private final java.util.function.BiFunction<? super T,​? super T,​? extends R> mapper
      • cur

        private T cur
    • Constructor Detail

      • PSOfRef

        PSOfRef​(java.util.function.BiFunction<? super T,​? super T,​? extends R> mapper,
                java.util.Spliterator<T> source)
      • PSOfRef

        PSOfRef​(java.util.function.Function<? super T,​? extends R> mapper,
                java.util.Spliterator<T> source,
                boolean first)
      • PSOfRef

        PSOfRef​(java.util.function.Function<? super T,​? extends R> boundMapper,
                java.util.function.Function<? super T,​? extends R> elseMapper,
                java.util.Spliterator<T> source,
                boolean first)
    • Method Detail

      • accept

        public void accept​(T t)
        Specified by:
        accept in interface java.util.function.Consumer<T>
      • fn

        private java.util.function.BiConsumer<T,​T> fn​(java.util.function.Consumer<? super R> action)
      • tryAdvance

        public boolean tryAdvance​(java.util.function.Consumer<? super R> action)
        Specified by:
        tryAdvance in interface java.util.Spliterator<T>
      • forEachRemaining

        public void forEachRemaining​(java.util.function.Consumer<? super R> action)
        Specified by:
        forEachRemaining in interface java.util.Spliterator<T>
      • tryAdvanceOrTail

        public java.util.Spliterator<R> tryAdvanceOrTail​(java.util.function.Consumer<? super R> action)
        Description copied from interface: Internals.TailSpliterator
        Either advances by one element feeding it to consumer and returns this or returns tail spliterator (this spliterator becomes invalid and tail must be used instead) or returns null if traversal finished.
        Specified by:
        tryAdvanceOrTail in interface Internals.TailSpliterator<T>
        Parameters:
        action - to feed the next element into
        Returns:
        tail spliterator, this or null
      • forEachOrTail

        public java.util.Spliterator<R> forEachOrTail​(java.util.function.Consumer<? super R> action)
        Description copied from interface: Internals.TailSpliterator
        Traverses this spliterator and returns null if traversal is completed or tail spliterator if it must be used for further traversal.
        Specified by:
        forEachOrTail in interface Internals.TailSpliterator<T>
        Parameters:
        action - to feed the elements into
        Returns:
        tail spliterator or null (never returns this)