Freigeben über


Collectors.ToCollection(ISupplier) Method

Definition

Returns a Collector that accumulates the input elements into a new Collection, in encounter order.

[Android.Runtime.Register("toCollection", "(Ljava/util/function/Supplier;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "C extends java.util.Collection<T>" })]
public static Java.Util.Streams.ICollector? ToCollection (Java.Util.Functions.ISupplier? collectionFactory);
[<Android.Runtime.Register("toCollection", "(Ljava/util/function/Supplier;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "C extends java.util.Collection<T>" })>]
static member ToCollection : Java.Util.Functions.ISupplier -> Java.Util.Streams.ICollector

Parameters

collectionFactory
ISupplier

a supplier providing a new empty Collection into which the results will be inserted

Returns

a Collector which collects all the input elements into a Collection, in encounter order

Attributes

Remarks

Returns a Collector that accumulates the input elements into a new Collection, in encounter order. The Collection is created by the provided factory.

Java documentation for java.util.stream.Collectors.toCollection(java.util.function.Supplier<C>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to