8130023: API java.util.stream: explicitly specify guaranteed execution of the pipeline

Reviewed-by: briangoetz, redestad
This commit is contained in:
Paul Sandoz 2016-05-20 11:47:39 +02:00
parent e988331331
commit 53ef4fecbf
5 changed files with 58 additions and 8 deletions

View file

@ -209,6 +209,11 @@ public interface IntStream extends BaseStream<Integer, IntStream> {
* .sum();
* }</pre>
*
* <p>In cases where stream implementation is able to optimize away the
* production of some or all the elements (such as with short-circuiting
* operations like {@code findFirst}, or in the example described in
* {@link #count}), the action will not be invoked for those elements.
*
* @param action a <a href="package-summary.html#NonInterference">
* non-interfering</a> action to perform on the elements as
* they are consumed from the stream