src/share/classes/java/util/stream/Stream.java

Print this page
rev 7594 : 8015315: Stream.concat methods
Contributed-by: brian.goetz@oracle.com, henry.jen@oracle.com
rev 7597 : 8015318: Extend Collector with 'finish' operation
Reviewed-by:
Contributed-by: brian.goetz@oracle.com

@@ -649,16 +649,17 @@
      *         = personStream.collect(Collectors.groupBy(Person::getState,
      *                                                   Collectors.groupBy(Person::getCity)));
      * }</pre>
      *
      * @param <R> the type of the result
+     * @param <A> the intermediate accumulation type of the {@code Collector}
      * @param collector the {@code Collector} describing the reduction
      * @return the result of the reduction
      * @see #collect(Supplier, BiConsumer, BiConsumer)
      * @see Collectors
      */
-    <R> R collect(Collector<? super T, R> collector);
+    <R, A> R collect(Collector<? super T, A, R> collector);
 
     /**
      * Returns the minimum element of this stream according to the provided
      * {@code Comparator}.  This is a special case of a
      * <a href="package-summary.html#MutableReduction">reduction</a>.