Please note that the specifications and other information contained herein are not final and are subject to change. The information is being made available to you solely for purpose of evaluation.
Java™ Platform
Standard Ed. 8

DRAFT ea-b00
compact1, compact2, compact3
java.util.stream

Interface Stream<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      boolean allMatch(Predicate<? super T> predicate)
      Return whether all elements of this stream match the provided Predicate.
      boolean anyMatch(Predicate<? super T> predicate)
      Return whether any elements of this stream match the provided Predicate.
      <R> R collect(Collector<? super T,R> collector)
      Perform a mutable reduction operation on the elements of this stream using a Collector object to describe the reduction.
      <R> R collect(Supplier<R> resultFactory, BiConsumer<R,? super T> accumulator, BiConsumer<R,R> combiner)
      Perform a mutable reduction operation on the elements of this stream.
      <R> R collectUnordered(Collector<? super T,R> collector)
      Perform a mutable reduction operation on the elements of this stream using a Collector object to describe the reduction, without regard to encounter order.
      long count()
      Return the count of elements in this stream.
      Stream<T> distinct()
      Produce a stream consisting of the distinct elements (according to Object.equals(Object)) of this stream.
      Stream<T> filter(Predicate<? super T> predicate)
      Produce a stream consisting of the elements of this stream that match the given Predicate.
      Optional<T> findAny()
      Return an Optional describing some element of the stream, or an empty Optional if the stream is empty.
      Optional<T> findFirst()
      Return an Optional describing the first element of this stream (in the encounter order), or an empty Optional if the stream is empty.
      <R> Stream<R> flatMap(FlatMapper<? super T,R> mapper)
      Produce a Stream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.
      <R> Stream<R> flatMap(Function<T,Stream<? extends R>> mapper)
      Produce a Stream consisting of the results of replacing each element of this stream with the contents of the Stream produced by applying the provided Function to each element.
      DoubleStream flatMapToDouble(FlatMapper.ToDouble<? super T> mapper)
      Produce a DoubleStream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.
      IntStream flatMapToInt(FlatMapper.ToInt<? super T> mapper)
      Produce an IntStream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.
      LongStream flatMapToLong(FlatMapper.ToLong<? super T> mapper)
      Produce a LongStream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.
      void forEach(Consumer<? super T> consumer)
      Perform an operation for each element of this stream.
      void forEachOrdered(Consumer<? super T> consumer)
      Perform an operation for each element of this stream, guaranteeing that each element is processed in encounter order for streams that have a defined encounter order.
      void forEachUntilCancelled(Consumer<? super T> consumer, BooleanSupplier cancelledFunction)
      Perform an operation for each element of this stream, attempting to stop early if some external termination condition is reached.
      boolean isParallel()
      Returns whether this stream, when executed, will execute in parallel.
      Iterator<T> iterator()
      Returns an iterator for the elements of this stream.
      Stream<T> limit(long maxSize)
      Produce a Stream consisting of the elements of this stream, truncated to be no longer than maxSize in length.
      <R> Stream<R> map(Function<? super T,? extends R> mapper)
      Produce a stream consisting of the results of applying the given function to the elements of this stream.
      DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper)
      Produce a DoubleStream consisting of the results of applying the given function to the elements of this stream.
      IntStream mapToInt(ToIntFunction<? super T> mapper)
      Produce an IntStream consisting of the results of applying the given function to the elements of this stream.
      LongStream mapToLong(ToLongFunction<? super T> mapper)
      Produce a LongStream consisting of the results of applying the given function to the elements of this stream.
      Optional<T> max(Comparator<? super T> comparator)
      Return the maximal element of this stream according to the provided Comparator.
      Optional<T> min(Comparator<? super T> comparator)
      Return the minimal element of this stream according to the provided Comparator.
      boolean noneMatch(Predicate<? super T> predicate)
      Return whether no elements of this stream match the provided Predicate.
      S parallel()
      Produces an equivalent stream that is parallel.
      Stream<T> peek(Consumer<? super T> consumer)
      Produce a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream.
      Optional<T> reduce(BinaryOperator<T> accumulator)
      Perform a reduction on the elements of this stream, using an associative accumulation function, and return an Optional describing the reduced value, if any.
      T reduce(T identity, BinaryOperator<T> accumulator)
      Perform a reduction on the elements of this stream, using the provided identity value and an associative accumulation function, and return the reduced value.
      <U> U reduce(U identity, BiFunction<U,? super T,U> accumulator, BinaryOperator<U> combiner)
      Perform a reduction on the elements of this stream, using the provided identity, accumulation function, and a combining functions.
      S sequential()
      Produces an equivalent stream that is sequential.
      Stream<T> sorted()
      Produce a stream consisting of the elements of this stream, sorted according to natural order.
      Stream<T> sorted(Comparator<? super T> comparator)
      Produce a stream consisting of the elements of this stream, sorted according to the provide Comparator.
      Spliterator<T> spliterator()
      Returns a spliterator for the elements of this stream.
      Stream<T> substream(long startingOffset)
      Produce a Stream consistent of the elements of this stream, discarding the first startingOffset elements.
      Stream<T> substream(long startingOffset, long endingOffset)
      Produce a Stream consisting of the elements of this stream, discarding the first startingOffset elements, and truncating the remainder to be no longer than maxSize in length.
      Object[] toArray()
      Produce an array containing the elements of this stream.
      <A> A[] toArray(IntFunction<A[]> generator)
      Produce an array containing the elements of this stream, using the provided generator function to allocate the returned array.
    • Method Detail

      • filter

        Stream<T> filter(Predicate<? super T> predicate)
        Produce a stream consisting of the elements of this stream that match the given Predicate.

        This is an intermediate operation.

        Parameters:
        predicate - A non-interfering, stateless predicate to apply to each element to determine if it should be included
        Returns:
        the new stream
      • map

        <R> Stream<R> map(Function<? super T,? extends R> mapper)
        Produce a stream consisting of the results of applying the given function to the elements of this stream.

        This is an intermediate operation.

        Parameters:
        mapper - a non-interfering, stateless function to be applied to each element
        Returns:
        the new stream
      • flatMap

        <R> Stream<R> flatMap(Function<T,Stream<? extends R>> mapper)
        Produce a Stream consisting of the results of replacing each element of this stream with the contents of the Stream produced by applying the provided Function to each element.

        This is an intermediate operation.

        Parameters:
        mapper - A non-interfering, stateless function to be applied to each element which produces a Stream of new values
        Returns:
        the new stream
        API Note
        The "flatMap" operation has the effect of applying a one-to-many tranformation to the elements of the stream, and then flattening the resulting elements into a new stream. For example, if @{code orders} is a stream of purchase orders, and each purchase order contains a collection of line items, then the following produces a stream of line items:
             orderStream.flatMap(order -> order.getLineItems().stream())...
         

        This implementation is likely to be less efficient than the other form of flatMap(FlatMapper), and is provided for convenience.

      • flatMap

        <R> Stream<R> flatMap(FlatMapper<? super T,R> mapper)
        Produce a Stream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.

        This is an intermediate operation.

        Parameters:
        mapper - A non-interfering, stateless FlatMapper that transforms each element into zero or more resulting values
        Returns:
        the new stream
        API Note
        A FlatMapper is like a function that receives an element to transform, and a Consumer into which it deposits zero or more values corresponding to that element. For example, to map a stream of strings into a stream of the characters in those strings, you would do:
             stringStream.flatMap((elt, destination) -> {
                                      for (i=0; i < elt.length(); i++)
                                          destination.accept(charAt(i));
                                  })
                         ...
         
        Implementation Note
        This form of flatMap is usually less convenient to use than the flatMap(Function) form, but is often considerably more efficient because it eliminates the overhead of stream construction and traversal.
      • flatMapToInt

        IntStream flatMapToInt(FlatMapper.ToInt<? super T> mapper)
        Produce an IntStream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.

        This is an intermediate operation.

        Parameters:
        mapper - A non-interfering, stateless FlatMapper.ToInt that transforms each element into zero or more resulting values
        Returns:
        the new stream
        See Also:
        flatMap(FlatMapper)
        Implementation Note
        This form of flatMap is usually less convenient to use than the flatMap(Function) form, but is often considerably more efficient because it eliminates the overhead of stream construction and traversal.
      • flatMapToLong

        LongStream flatMapToLong(FlatMapper.ToLong<? super T> mapper)
        Produce a LongStream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.

        This is an intermediate operation.

        Parameters:
        mapper - A non-interfering, stateless FlatMapper.ToLong that transforms each element into zero or more resulting values
        Returns:
        the new stream
        See Also:
        flatMap(FlatMapper)
        Implementation Note
        This form of flatMap is usually less convenient to use than the flatMap(Function) form, but is often considerably more efficient because it eliminates the overhead of stream construction and traversal.
      • flatMapToDouble

        DoubleStream flatMapToDouble(FlatMapper.ToDouble<? super T> mapper)
        Produce a DoubleStream consisting of the results of replacing each element of this stream with zero or more transformed values, according to the transformation encoded in the provided FlatMapper.

        This is an intermediate operation.

        Parameters:
        mapper - A non-interfering, stateless FlatMapper.ToDouble that transforms each element into zero or more resulting values
        Returns:
        the new stream
        See Also:
        flatMap(FlatMapper)
        Implementation Note
        This form of flatMap is usually less convenient to use than the flatMap(Function) form, but is often considerably more efficient because it eliminates the overhead of stream construction and traversal.
      • sorted

        Stream<T> sorted()
        Produce a stream consisting of the elements of this stream, sorted according to natural order. If the elements of this stream are not Comparable, a java.lang.ClassCastException may be thrown when the stream pipeline is executed.

        This is a stateful intermediate operation.

        Returns:
        the new stream
      • forEach

        void forEach(Consumer<? super T> consumer)
        Perform an operation for each element of this stream.

        This is a terminal operation.

        For parallel stream pipelines, this operation does not guarantee to respect the encounter order of the stream, as doing so would sacrifice the benefit of parallelism. For any given element, the action may be performed at whatever time and in whatever thread the library chooses. If the operation accesses shared state, it is responsible for providing the required synchronization.

        Parameters:
        consumer - A non-interfering action to perform on the elements
      • forEachOrdered

        void forEachOrdered(Consumer<? super T> consumer)
        Perform an operation for each element of this stream, guaranteeing that each element is processed in encounter order for streams that have a defined encounter order.

        This is a terminal operation.

        Parameters:
        consumer - A non-interfering action to perform on the elements
        See Also:
        forEach(Consumer)
      • forEachUntilCancelled

        void forEachUntilCancelled(Consumer<? super T> consumer,
                                 BooleanSupplier cancelledFunction)
        Perform an operation for each element of this stream, attempting to stop early if some external termination condition is reached.

        This is a short-circuiting terminal operation.

        For parallel stream pipelines, this operation does not guarantee to respect the encounter order of the stream, as doing so would sacrifice the benefit of parallelism. For any given element, the action may be performed at whatever time and in whatever thread the library chooses. If the operation accesses shared state, it is responsible for providing the required synchronization.

        Parameters:
        consumer - A non-interfering action to perform on the elements
        cancelledFunction - A BooleanSupplier that indicates whether the termination criteria has occurred. Once it returns @{code true} the first time, it must continue to return true for all future invocations
      • peek

        Stream<T> peek(Consumer<? super T> consumer)
        Produce a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream.

        This is an intermediate operation.

        For parallel stream pipelines, the Consumer may be called at whatever time and in whatever thread the element is made available by the upstream operation. If the Consumer modifies shared state, it is responsible for providing the required synchronization.

        Parameters:
        consumer - A non-interfering action to perform on the elements as they are consumed from the stream
        Returns:
        the new stream
        API Note
        This method exists mainly to support debugging, where you want to see the elements as they flow past a certain point in a pipeline:
             list.stream()
                 .filter(filteringFunction)
                 .peek(e -> {System.out.println("Filtered value: " + e); });
                 .map(mappingFunction)
                 .peek(e -> {System.out.println("Mapped value: " + e); });
                 .collect(Collectors.intoList());
         
      • limit

        Stream<T> limit(long maxSize)
        Produce a Stream consisting of the elements of this stream, truncated to be no longer than maxSize in length.

        This is a short-circuiting stateful intermediate operation.

        Parameters:
        maxSize - the number of elements the stream should be limited to
        Returns:
        the new stream
      • substream

        Stream<T> substream(long startingOffset)
        Produce a Stream consistent of the elements of this stream, discarding the first startingOffset elements.

        This is a stateful intermediate operation.

        Parameters:
        startingOffset - the number of leading elements to be skipped
        Returns:
        the new stream
      • substream

        Stream<T> substream(long startingOffset,
                          long endingOffset)
        Produce a Stream consisting of the elements of this stream, discarding the first startingOffset elements, and truncating the remainder to be no longer than maxSize in length.

        This is a short-circuiting stateful intermediate operation.

        Parameters:
        startingOffset - the starting position of the substream, inclusive
        endingOffset - the ending position of the substream, exclusive
        Returns:
        the new stream
      • toArray

        Object[] toArray()
        Produce an array containing the elements of this stream.

        This is a terminal operation.

        Returns:
        an array containing the elements of this stream
      • toArray

        <A> A[] toArray(IntFunction<A[]> generator)
        Produce an array containing the elements of this stream, using the provided generator function to allocate the returned array.

        This is a terminal operation.

        Type Parameters:
        A - the element type of the resulting array
        Parameters:
        generator - a function which produces a new array of the desired type and the provided length
        Returns:
        an array containing the elements in this stream
        Throws:
        ArrayStoreException - if the runtime type of the array returned from the array generator is not a supertype of the runtime type of every element in this stream
      • reduce

        T reduce(T identity,
               BinaryOperator<T> accumulator)
        Perform a reduction on the elements of this stream, using the provided identity value and an associative accumulation function, and return the reduced value. This is equivalent to:
             T result = identity;
             for (T element : this stream)
                 result = accumulator.apply(result, element)
             return result;
         
        but is not constrained to execute sequentially.

        The identity value must be an identity for the accumulator function. This means that for all t, accumulator.apply(identity, t) is equal to t. The accumulator function must be an associative function.

        This is a terminal operation.

        Parameters:
        identity - The identity value for the accumulating function
        accumulator - An associative non-interfering, stateless function for combining two values
        Returns:
        The result of the reduction
        API Note
        Sum, min, max, average, and string concatenation are all special cases of reduction. Summing a stream of numbers can be expressed as:
             Integer sum = integers.reduce(0, (a, b) -> a+b);
         
        or more compactly:
             Integer sum = integers.reduce(0, Integer::sum);
         

        While this may seem a more roundabout way to perform an aggregation compared to simply mutating a running total in a loop, reduction operations parallelize more gracefully, without needing additional synchronization and with greatly reduced risk of data races.

      • reduce

        Optional<T> reduce(BinaryOperator<T> accumulator)
        Perform a reduction on the elements of this stream, using an associative accumulation function, and return an Optional describing the reduced value, if any. This is equivalent to:
             boolean foundAny = false;
             T result = null;
             for (T element : this stream) {
                 if (!foundAny) {
                     foundAny = true;
                     result = element;
                 }
                 else
                     result = accumulator.apply(result, element)
             return foundAny ? Optional.of(result) : Optional.empty();
         
        but is not constrained to execute sequentially.

        The accumulator function must be an associative function.

        This is a terminal operation.

        Parameters:
        accumulator - An associative non-interfering, stateless function for combining two values
        Returns:
        The result of the reduction
        See Also:
        reduce(Object, BinaryOperator)
      • reduce

        <U> U reduce(U identity,
                   BiFunction<U,? super T,U> accumulator,
                   BinaryOperator<U> combiner)
        Perform a reduction on the elements of this stream, using the provided identity, accumulation function, and a combining functions. This is equivalent to:
             U result = identity;
             for (T element : this stream)
                 result = accumulator.apply(result, element)
             return result;
         
        but is not constrained to execute sequentially.

        The identity value must be an identity for the combiner function. This means that for all u, combiner(identity, u) is equal to u. Additionally, the combiner function must be compatible with the accumulator function; for all u and t, the following must hold:

             combiner.apply(u, accumulator.apply(identity, t)) == accumulator.apply(u, t)
         

        This is a terminal operation.

        Type Parameters:
        U - The type of the result
        Parameters:
        identity - The identity value for the combiner function
        accumulator - An associative non-interfering, stateless function for incorporating an additional element into a result
        combiner - An associative non-interfering, stateless function for combining two values, which must be compatible with the accumulator function
        Returns:
        The result of the reduction
        See Also:
        reduce(BinaryOperator), reduce(Object, BinaryOperator)
        API Note
        Many reductions using this form can be represented more simply by an explicit combination of map and reduce operations. The accumulator function acts as a fused mapper and accumulator, which can sometimes be more efficient than separate mapping and reduction, such as in the case where knowing the previously reduced value allows you to avoid some computation.
      • collect

        <R> R collect(Supplier<R> resultFactory,
                    BiConsumer<R,? super T> accumulator,
                    BiConsumer<R,R> combiner)
        Perform a mutable reduction operation on the elements of this stream. A mutable reduction is one in which the reduced value is a mutable value holder, such as an ArrayList, and elements are incorporated by updating the state of the result, rather than by replacing the result. This produces a result equivalent to:
             R result = resultFactory.get();
             for (T element : this stream)
                 accumulator.accept(result, element);
             return result;
         
        Like reduce(Object, BinaryOperator), collect operations can be parallelized without requiring additional sychronization.

        This is a terminal operation.

        Type Parameters:
        R - Type of the result
        Parameters:
        resultFactory - Function that creates a new result container. For a parallel execution, this function may be called multiple times and must return a fresh value each time.
        accumulator - An associative non-interfering, stateless function for incorporating an additional element into a result
        combiner - An associative non-interfering, stateless function for combining two values, which must be compatible with the accumulator function
        Returns:
        The result of the reduction
        API Note
        There are many existing classes in the JDK whose signatures are a good match for use as arguments to collect(). For example, the following will accumulate strings into an ArrayList:
             List<String> asList = stringStream.collect(ArrayList::new, ArrayList::add, ArrayList::addAll);
         
        The following will take a stream of strings and concatenates them into a single string:
             String concat = stringStream.collect(StringBuilder::new, StringBuilder::append,
                                                  StringBuilder::append)
                                         .toString();
         
      • collect

        <R> R collect(Collector<? super T,R> collector)
        Perform a mutable reduction operation on the elements of this stream using a Collector object to describe the reduction. A Collector encapsulates the functions used as arguments to collect(Supplier, BiConsumer, BiConsumer), allowing for reuse of collection strategies, and composition of collect operations such as multiple-level grouping or partitioning.

        This is a terminal operation. When executed in parallel, multiple intermediate results may be instantiated, populated, and merged, so as to maintain isolation of mutable data structures. Therefore, even when executed in parallel with non-thread-safe data structures (such as ArrayList), no additional synchronization is needed for a parallel reduction.

        Type Parameters:
        R - The type of the result
        Parameters:
        collector - The Collector describing the reduction
        Returns:
        The result of the reduction
        See Also:
        collect(Supplier, BiConsumer, BiConsumer), Collectors
        API Note
        The following will accumulate strings into an ArrayList:
             List<String> asList = stringStream.collect(Collectors.toList());
         }
        The following will classify Person objects by city:
             Map<String, Collection<Person>> peopleByCity
                 = personStream.collect(Collectors.groupBy(Person::getCity));
         
        The following will classify Person objects by state and city, cascading two Collectors together:
             Map<String, Map<String, Collection<Person>>> peopleByStateAndCity
                 = personStream.collect(Collectors.groupBy(Person::getState,
                                                           Collectors.groupBy(Person::getCity)));
         
      • collectUnordered

        <R> R collectUnordered(Collector<? super T,R> collector)
        Perform a mutable reduction operation on the elements of this stream using a Collector object to describe the reduction, without regard to encounter order. If the provided Collector is concurrent, this implementation may invoke the function returned by Collector.accumulator() concurrently on the same result object. In some cases, implementing a reduction by concurrently modifying a shared data structure may be more efficient than partitioning and merging.

        This is a terminal operation.

        Type Parameters:
        R - The type of the result
        Parameters:
        collector - The Collector describing the reduction
        Returns:
        The result of the reduction
        See Also:
        collect(Supplier, BiConsumer, BiConsumer), Collectors
      • max

        Optional<T> max(Comparator<? super T> comparator)
        Return the maximal element of this stream according to the provided Comparator.

        This is a terminal operation.

        Parameters:
        comparator - A non-interfering, stateless Comparator to use to compare elements of this stream
        Returns:
        An Optional describing the maximal element of this stream, or an empty Optional if the stream is empty
      • min

        Optional<T> min(Comparator<? super T> comparator)
        Return the minimal element of this stream according to the provided Comparator.

        This is a terminal operation.

        Parameters:
        comparator - A non-interfering, stateless Comparator to use to compare elements of this stream
        Returns:
        An Optional describing the minimal element of this stream, or an empty Optional if the stream is empty
      • count

        long count()
        Return the count of elements in this stream.

        This is a terminal operation.

        Returns:
        The count of elements in this stream.
      • anyMatch

        boolean anyMatch(Predicate<? super T> predicate)
        Return whether any elements of this stream match the provided Predicate. May not evaluate the predicate on all elements if not necessary for determining the result.

        This is a short-circuiting terminal operation.

        Parameters:
        predicate - A non-interfering, stateless predicate to apply to elements of this stream
        Returns:
        Whether any elements of the stream match the provided predicate
      • allMatch

        boolean allMatch(Predicate<? super T> predicate)
        Return whether all elements of this stream match the provided Predicate. May not evaluate the predicate on all elements if not necessary for determining the result.

        This is a short-circuiting terminal operation.

        Parameters:
        predicate - A non-interfering, stateless predicate to apply to elements of this stream
        Returns:
        Whether all elements of the stream match the provided predicate
      • noneMatch

        boolean noneMatch(Predicate<? super T> predicate)
        Return whether no elements of this stream match the provided Predicate. May not evaluate the predicate on all elements if not necessary for determining the result.

        This is a short-circuiting terminal operation.

        Parameters:
        predicate - A non-interfering, stateless predicate to apply to elements of this stream
        Returns:
        Whether no elements of the stream match the provided predicate
      • findFirst

        Optional<T> findFirst()
        Return an Optional describing the first element of this stream (in the encounter order), or an empty Optional if the stream is empty.

        This is a short-circuiting terminal operation.

        Returns:
        An Optional describing the first element of this stream, or an empty Optional if the stream is empty
      • findAny

        Optional<T> findAny()
        Return an Optional describing some element of the stream, or an empty Optional if the stream is empty.

        This is a short-circuiting terminal operation.

        The behavior of this operation is explicitly nondeterministic; it is free to select any element in the stream. This is to allow for maximal performance in parallel operations; the cost is that multiple invocations on the same source may not return the same result. (If the first element in the encounter order is desired, use findFirst() instead.)

        Returns:
        An Optional describing some element of this stream, or an empty Optional if the stream is empty
        See Also:
        findFirst()
      • iterator

        Iterator<T> iterator()
        Returns an iterator for the elements of this stream.

        This is a terminal operation.

        Returns:
        the element iterator for this stream
      • spliterator

        Spliterator<T> spliterator()
        Returns a spliterator for the elements of this stream.

        This is a terminal operation.

        Returns:
        the element spliterator for this stream
      • isParallel

        boolean isParallel()
        Returns whether this stream, when executed, will execute in parallel. Calling this method after invoking an intermediate or terminal stream operation method may yield unpredictable results.
        Returns:
        whether this stream will execute in parallel
      • sequential

        S sequential()
        Produces an equivalent stream that is sequential. If this stream is already sequential, may return itself.

        This is a stateful intermediate operation.

        Returns:
        a sequential stream
      • parallel

        S parallel()
        Produces an equivalent stream that is parallel. If this stream is already parallel, may return itself.

        This is a stateful intermediate operation.

        Returns:
        a parallel stream
Java™ Platform
Standard Ed. 8

DRAFT ea-b00

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.

DRAFT ea-b00