src/share/classes/java/util/stream/package-info.java

Print this page

        

*** 139,149 **** * {@link java.util.stream Stream#sequential()} and {@link java.util.stream.Stream#parallel()} * operations. The {@code Stream} implementations in the JDK create serial streams unless * parallelism is explicitly requested. For example, {@code Collection} has methods * {@link java.util.Collection#stream} and {@link java.util.Collection#parallelStream}, * which produce sequential and parallel streams respectively; other stream-bearing methods ! * such as {@link java.util.stream.Streams#intRange(int, int)} produce sequential * streams but these can be efficiently parallelized by calling {@code parallel()} on the * result. The set of operations on serial and parallel streams is identical. To execute the * "sum of weights of blocks" query in parallel, we would do: * * <pre>{@code --- 139,149 ---- * {@link java.util.stream Stream#sequential()} and {@link java.util.stream.Stream#parallel()} * operations. The {@code Stream} implementations in the JDK create serial streams unless * parallelism is explicitly requested. For example, {@code Collection} has methods * {@link java.util.Collection#stream} and {@link java.util.Collection#parallelStream}, * which produce sequential and parallel streams respectively; other stream-bearing methods ! * such as {@link java.util.stream.IntStream#range(int, int)} produce sequential * streams but these can be efficiently parallelized by calling {@code parallel()} on the * result. The set of operations on serial and parallel streams is identical. To execute the * "sum of weights of blocks" query in parallel, we would do: * * <pre>{@code