changeset 8346:060cc7d29ee4

merge javadoc corrections.
author mduigou
date Mon, 22 Apr 2013 12:40:28 -0700
parents d62a39940550
children 10c1d69b833b
files src/share/classes/java/util/Objects.java src/share/classes/java/util/stream/DoubleStream.java src/share/classes/java/util/stream/IntStream.java src/share/classes/java/util/stream/LongStream.java src/share/classes/java/util/stream/Stream.java src/share/classes/java/util/stream/StreamShape.java
diffstat 6 files changed, 85 insertions(+), 77 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/Objects.java	Mon Apr 22 12:08:25 2013 -0700
+++ b/src/share/classes/java/util/Objects.java	Mon Apr 22 12:40:28 2013 -0700
@@ -241,7 +241,7 @@
      * {@code false}.
      *
      * @see java.util.function.Predicate
-     * @since 1.8y
+     * @since 1.8
      */
     public static boolean isNull(Object obj) {
         return obj == null;
--- a/src/share/classes/java/util/stream/DoubleStream.java	Mon Apr 22 12:08:25 2013 -0700
+++ b/src/share/classes/java/util/stream/DoubleStream.java	Mon Apr 22 12:40:28 2013 -0700
@@ -185,23 +185,26 @@
     DoubleStream flatMap(DoubleFunction<? extends DoubleStream> mapper);
 
     /**
-     * Returns a stream consisting of the distinct elements of this stream.
+     * Returns a stream consisting of the distinct elements of this stream. The
+     * elements are compared for equality according to
+     * {@link java.lang.Double#compare(double, double)}.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @return the new stream
+     * @return the result stream
      */
     DoubleStream distinct();
 
     /**
      * Returns a stream consisting of the elements of this stream in sorted
-     * order.
+     * order. The elements are compared for equality according to
+     * {@link java.lang.Double#compare(double, double)}.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @return the new stream
+     * @return the result stream
      */
     DoubleStream sorted();
 
@@ -237,8 +240,8 @@
     DoubleStream peek(DoubleConsumer consumer);
 
     /**
-     * Returns a stream consisting of the elements of this stream,
-     * truncated to be no longer than {@code maxSize} in length.
+     * Returns a stream consisting of the elements of this stream, truncated
+     * to be no longer than {@code maxSize} in length.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
@@ -251,36 +254,37 @@
 
     /**
      * Returns a stream consisting of the remaining elements of this stream
-     * after discarding the first {@code startingOffset} elements (or all
-     * elements if the stream has fewer than {@code startingOffset} elements).
+     * after indexing {@code startInclusive} elements into the stream. If the
+     * {@code startInclusive} index lies past the end of this stream then an
+     * empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @param startingOffset the number of leading elements to skip
+     * @param startInclusive the number of leading elements to skip
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} is negative
+     * @throws IllegalArgumentException if {@code startInclusive} is negative
      */
-    DoubleStream substream(long startingOffset);
+    DoubleStream substream(long startInclusive);
 
     /**
-     * Returns a stream consisting of the elements of this stream after
-     * discarding the first {@code startingOffset} elements (or all elements
-     * if the stream has fewer than {@code startingOffset} elements), and
-     * truncating the remainder to be no longer than
-     * {@code endingOffset - startOffset} in length.
+     * Returns a stream consisting of the remaining elements of this stream
+     * after indexing {@code startInclusive} elements into the stream and
+     * truncated to contain no more than {@code endExclusive - startInclusive}
+     * elements. If the {@code startInclusive} index lies past the end
+     * of this stream then an empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
      *
-     * @param startingOffset the starting position of the substream, inclusive
-     * @param endingOffset the ending position of the substream, exclusive
+     * @param startInclusive the starting position of the substream, inclusive
+     * @param endExclusive the ending position of the substream, exclusive
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} or
-     * {@code endingOffset} is negative or {@code startingOffset} is greater
-     * than {@code endingOffset}
+     * @throws IllegalArgumentException if {@code startInclusive} or
+     * {@code endExclusive} is negative or {@code startInclusive} is greater
+     * than {@code endExclusive}
      */
-    DoubleStream substream(long startingOffset, long endingOffset);
+    DoubleStream substream(long startInclusive, long endExclusive);
 
     /**
      * Performs an action for each element of this stream.
--- a/src/share/classes/java/util/stream/IntStream.java	Mon Apr 22 12:08:25 2013 -0700
+++ b/src/share/classes/java/util/stream/IntStream.java	Mon Apr 22 12:40:28 2013 -0700
@@ -238,8 +238,8 @@
     IntStream peek(IntConsumer consumer);
 
     /**
-     * Returns a stream consisting of the elements of this stream,
-     * truncated to be no longer than {@code maxSize} in length.
+     * Returns a stream consisting of the elements of this stream, truncated
+     * to be no longer than {@code maxSize} in length.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
@@ -252,36 +252,37 @@
 
     /**
      * Returns a stream consisting of the remaining elements of this stream
-     * after discarding the first {@code startingOffset} elements (or all
-     * elements if the stream has fewer than {@code startingOffset} elements).
+     * after indexing {@code startInclusive} elements into the stream. If the
+     * {@code startInclusive} index lies past the end of this stream then an
+     * empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @param startingOffset the number of leading elements to skip
+     * @param startInclusive the number of leading elements to skip
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} is negative
+     * @throws IllegalArgumentException if {@code startInclusive} is negative
      */
-    IntStream substream(long startingOffset);
+    IntStream substream(long startInclusive);
 
     /**
-     * Returns a stream consisting of the elements of this stream after
-     * discarding the first {@code startingOffset} elements (or all elements
-     * if the stream has fewer than {@code startingOffset} elements), and
-     * truncating the remainder to be no longer than
-     * {@code endingOffset - startOffset} in length.
+     * Returns a stream consisting of the remaining elements of this stream
+     * after indexing {@code startInclusive} elements into the stream and
+     * truncated to contain no more than {@code endExclusive - startInclusive}
+     * elements. If the {@code startInclusive} index lies past the end
+     * of this stream then an empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
      *
-     * @param startingOffset the starting position of the substream, inclusive
-     * @param endingOffset the ending position of the substream, exclusive
+     * @param startInclusive the starting position of the substream, inclusive
+     * @param endExclusive the ending position of the substream, exclusive
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} or
-     * {@code endingOffset} is negative or {@code startingOffset} is greater
-     * than {@code endingOffset}
+     * @throws IllegalArgumentException if {@code startInclusive} or
+     * {@code endExclusive} is negative or {@code startInclusive} is greater
+     * than {@code endExclusive}
      */
-    IntStream substream(long startingOffset, long endingOffset);
+    IntStream substream(long startInclusive, long endExclusive);
 
     /**
      * Performs an action for each element of this stream.
--- a/src/share/classes/java/util/stream/LongStream.java	Mon Apr 22 12:08:25 2013 -0700
+++ b/src/share/classes/java/util/stream/LongStream.java	Mon Apr 22 12:40:28 2013 -0700
@@ -238,8 +238,8 @@
     LongStream peek(LongConsumer consumer);
 
     /**
-     * Returns a stream consisting of the elements of this stream,
-     * truncated to be no longer than {@code maxSize} in length.
+     * Returns a stream consisting of the elements of this stream, truncated
+     * to be no longer than {@code maxSize} in length.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
@@ -252,35 +252,37 @@
 
     /**
      * Returns a stream consisting of the remaining elements of this stream
-     * after discarding the first {@code startingOffset} elements (or all
-     * elements if the stream has fewer than {@code startingOffset} elements).
+     * after indexing {@code startInclusive} elements into the stream. If the
+     * {@code startInclusive} index lies past the end of this stream then an
+     * empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @param startingOffset the number of leading elements to skip
+     * @param startInclusive the number of leading elements to skip
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} is negative
+     * @throws IllegalArgumentException if {@code startInclusive} is negative
      */
-    LongStream substream(long startingOffset);
+    LongStream substream(long startInclusive);
 
     /**
-     * Returns a stream consisting of the elements of this stream after
-     * discarding the first {@code startingOffset} elements (or all elements
-     * if the stream has fewer than {@code startingOffset} elements), and
-     * truncating the remainder to be no longer than {@code maxSize} in length.
+     * Returns a stream consisting of the remaining elements of this stream
+     * after indexing {@code startInclusive} elements into the stream and
+     * truncated to contain no more than {@code endExclusive - startInclusive}
+     * elements. If the {@code startInclusive} index lies past the end
+     * of this stream then an empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
      *
-     * @param startingOffset the starting position of the substream, inclusive
-     * @param endingOffset the ending position of the substream, exclusive
+     * @param startInclusive the starting position of the substream, inclusive
+     * @param endExclusive the ending position of the substream, exclusive
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} or
-     * {@code endingOffset} is negative or {@code startingOffset} is greater
-     * than {@code endingOffset}
+     * @throws IllegalArgumentException if {@code startInclusive} or
+     * {@code endExclusive} is negative or {@code startInclusive} is greater
+     * than {@code endExclusive}
      */
-    LongStream substream(long startingOffset, long endingOffset);
+    LongStream substream(long startInclusive, long endExclusive);
 
     /**
      * Performs an action for each element of this stream.
--- a/src/share/classes/java/util/stream/Stream.java	Mon Apr 22 12:08:25 2013 -0700
+++ b/src/share/classes/java/util/stream/Stream.java	Mon Apr 22 12:40:28 2013 -0700
@@ -315,8 +315,8 @@
     Stream<T> peek(Consumer<? super T> consumer);
 
     /**
-     * Returns a stream consisting of the elements of this stream,
-     * truncated to be no longer than {@code maxSize} in length.
+     * Returns a stream consisting of the elements of this stream, truncated
+     * to be no longer than {@code maxSize} in length.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
@@ -329,36 +329,37 @@
 
     /**
      * Returns a stream consisting of the remaining elements of this stream
-     * after discarding the first {@code startingOffset} elements (or all
-     * elements if the stream has fewer than {@code startingOffset} elements).
+     * after indexing {@code startInclusive} elements into the stream. If the
+     * {@code startInclusive} index lies past the end of this stream then an
+     * empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">stateful
      * intermediate operation</a>.
      *
-     * @param startingOffset the number of leading elements to skip
+     * @param startInclusive the number of leading elements to skip
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} is negative
+     * @throws IllegalArgumentException if {@code startInclusive} is negative
      */
-    Stream<T> substream(long startingOffset);
+    Stream<T> substream(long startInclusive);
 
     /**
-     * Returns a stream consisting of the elements of this stream after
-     * discarding the first {@code startingOffset} elements (or all elements
-     * if the stream has fewer than {@code startingOffset} elements), and
-     * truncating the remainder to be no longer than
-     * {@code endingOffset - startOffset} in length.
+     * Returns a stream consisting of the remaining elements of this stream
+     * after indexing {@code startInclusive} elements into the stream and
+     * truncated to contain no more than {@code endExclusive - startInclusive}
+     * elements. If the {@code startInclusive} index lies past the end
+     * of this stream then an empty stream will be returned.
      *
      * <p>This is a <a href="package-summary.html#StreamOps">short-circuiting
      * stateful intermediate operation</a>.
      *
-     * @param startingOffset the starting position of the substream, inclusive
-     * @param endingOffset the ending position of the substream, exclusive
+     * @param startInclusive the starting position of the substream, inclusive
+     * @param endExclusive the ending position of the substream, exclusive
      * @return the new stream
-     * @throws IllegalArgumentException if {@code startingOffset} or
-     * {@code endingOffset} is negative or {@code startingOffset} is greater
-     * than {@code endingOffset}
+     * @throws IllegalArgumentException if {@code startInclusive} or
+     * {@code endExclusive} is negative or {@code startInclusive} is greater
+     * than {@code endExclusive}
      */
-    Stream<T> substream(long startingOffset, long endingOffset);
+    Stream<T> substream(long startInclusive, long endExclusive);
 
     /**
      * Performs an action for each element of this stream.
--- a/src/share/classes/java/util/stream/StreamShape.java	Mon Apr 22 12:08:25 2013 -0700
+++ b/src/share/classes/java/util/stream/StreamShape.java	Mon Apr 22 12:40:28 2013 -0700
@@ -43,7 +43,7 @@
  * input shape.  When representing primitive streams in this way, the
  * generic type parameter should correspond to the wrapper type for that
  * primitive type.
- * 
+ *
  * @since 1.8
  */
 enum StreamShape {