jdk/src/java.base/share/classes/java/util/stream/DoubleStream.java
changeset 32002 e378c0dc767e
parent 31644 dbca10d053fd
child 35302 e4d2275861c3
equal deleted inserted replaced
32001:cd908e480e4e 32002:e378c0dc767e
   291      * nondeterministic; it is free to take any subset of matching elements
   291      * nondeterministic; it is free to take any subset of matching elements
   292      * (which includes the empty set).
   292      * (which includes the empty set).
   293      *
   293      *
   294      * <p>Independent of whether this stream is ordered or unordered if all
   294      * <p>Independent of whether this stream is ordered or unordered if all
   295      * elements of this stream match the given predicate then this operation
   295      * elements of this stream match the given predicate then this operation
   296      * takes all elements (the result is the same is the input), or if no
   296      * takes all elements (the result is the same as the input), or if no
   297      * elements of the stream match the given predicate then no elements are
   297      * elements of the stream match the given predicate then no elements are
   298      * taken (the result is an empty stream).
   298      * taken (the result is an empty stream).
   299      *
   299      *
   300      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
   300      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
   301      * stateful intermediate operation</a>.
   301      * stateful intermediate operation</a>.
   327      * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
   327      * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
   328      *                  <a href="package-summary.html#Statelessness">stateless</a>
   328      *                  <a href="package-summary.html#Statelessness">stateless</a>
   329      *                  predicate to apply to elements to determine the longest
   329      *                  predicate to apply to elements to determine the longest
   330      *                  prefix of elements.
   330      *                  prefix of elements.
   331      * @return the new stream
   331      * @return the new stream
       
   332      * @since 1.9
   332      */
   333      */
   333     default DoubleStream takeWhile(DoublePredicate predicate) {
   334     default DoubleStream takeWhile(DoublePredicate predicate) {
   334         Objects.requireNonNull(predicate);
   335         Objects.requireNonNull(predicate);
   335         // Reuses the unordered spliterator, which, when encounter is present,
   336         // Reuses the unordered spliterator, which, when encounter is present,
   336         // is safe to use as long as it configured not to split
   337         // is safe to use as long as it configured not to split
   359      *
   360      *
   360      * <p>Independent of whether this stream is ordered or unordered if all
   361      * <p>Independent of whether this stream is ordered or unordered if all
   361      * elements of this stream match the given predicate then this operation
   362      * elements of this stream match the given predicate then this operation
   362      * drops all elements (the result is an empty stream), or if no elements of
   363      * drops all elements (the result is an empty stream), or if no elements of
   363      * the stream match the given predicate then no elements are dropped (the
   364      * the stream match the given predicate then no elements are dropped (the
   364      * result is the same is the input).
   365      * result is the same as the input).
   365      *
   366      *
   366      * <p>This is a <a href="package-summary.html#StreamOps">stateful
   367      * <p>This is a <a href="package-summary.html#StreamOps">stateful
   367      * intermediate operation</a>.
   368      * intermediate operation</a>.
   368      *
   369      *
   369      * @implSpec
   370      * @implSpec
   393      * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
   394      * @param predicate a <a href="package-summary.html#NonInterference">non-interfering</a>,
   394      *                  <a href="package-summary.html#Statelessness">stateless</a>
   395      *                  <a href="package-summary.html#Statelessness">stateless</a>
   395      *                  predicate to apply to elements to determine the longest
   396      *                  predicate to apply to elements to determine the longest
   396      *                  prefix of elements.
   397      *                  prefix of elements.
   397      * @return the new stream
   398      * @return the new stream
       
   399      * @since 1.9
   398      */
   400      */
   399     default DoubleStream dropWhile(DoublePredicate predicate) {
   401     default DoubleStream dropWhile(DoublePredicate predicate) {
   400         Objects.requireNonNull(predicate);
   402         Objects.requireNonNull(predicate);
   401         // Reuses the unordered spliterator, which, when encounter is present,
   403         // Reuses the unordered spliterator, which, when encounter is present,
   402         // is safe to use as long as it configured not to split
   404         // is safe to use as long as it configured not to split