changeset 5972:ff45d6cfdffc it2-bootstrap

javadoc
author mduigou
date Wed, 05 Sep 2012 10:46:15 -0700
parents 685ce67a171b
children d7f2c76afeda
files src/share/classes/java/util/streams/MapStream.java src/share/classes/java/util/streams/Stream.java
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/streams/MapStream.java	Tue Sep 04 15:29:13 2012 -0700
+++ b/src/share/classes/java/util/streams/MapStream.java	Wed Sep 05 10:46:15 2012 -0700
@@ -28,7 +28,10 @@
 import java.util.functions.*;
 
 /**
- * A stream who's elements are key-value mappings.
+ * A sequence of elements each of which is a key value mapping. A stream is a
+ * consumable data structure. The elements of the stream are available for
+ * consumption by either iteration or an operation. Once consumed the elements
+ * are no longer available from the stream.
  *
  * @param <K> Type of mapping key.
  * @param <V> Type of mapping value.
@@ -36,6 +39,12 @@
  * @author Brian Goetz
  */
 public interface MapStream<K, V> {
+    /**
+     * Returns the iterator for this stream. Each stream has a single iterator
+     * that is shared by all consumers. Once the elements of the stream are
+     * consumed it is not possible to "rewind" the stream.
+     * @return
+     */
     MapIterator<K, V> iterator();
 
     boolean isParallel();
--- a/src/share/classes/java/util/streams/Stream.java	Tue Sep 04 15:29:13 2012 -0700
+++ b/src/share/classes/java/util/streams/Stream.java	Wed Sep 05 10:46:15 2012 -0700
@@ -29,7 +29,10 @@
 import java.util.streams.ops.IntermediateOp;
 
 /**
- * A source of elements which may be iterated or mutated.
+ * A potentially infinite sequence of elements. A stream is a consumable data
+ * structure. The elements of the stream are available for consumption by either
+ * iteration or an operation. Once consumed the elements are no longer available
+ * from the stream.
  *
  * @param <T> Type of elements.
  *