Collectors.ToConcurrentMap Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ToConcurrentMap(IFunction, IFunction, IBinaryOperator, ISupplier) |
Returns a concurrent |
ToConcurrentMap(IFunction, IFunction) |
Returns a concurrent |
ToConcurrentMap(IFunction, IFunction, IBinaryOperator) |
Returns a concurrent |
ToConcurrentMap(IFunction, IFunction, IBinaryOperator, ISupplier)
Returns a concurrent Collector
that accumulates elements into a
ConcurrentMap
whose keys and values are the result of applying
the provided mapping functions to the input elements.
[Android.Runtime.Register("toConcurrentMap", "(Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/function/BinaryOperator;Ljava/util/function/Supplier;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "K", "U", "M extends java.util.concurrent.ConcurrentMap<K, U>" })]
public static Java.Util.Streams.ICollector? ToConcurrentMap (Java.Util.Functions.IFunction? keyMapper, Java.Util.Functions.IFunction? valueMapper, Java.Util.Functions.IBinaryOperator? mergeFunction, Java.Util.Functions.ISupplier? mapFactory);
[<Android.Runtime.Register("toConcurrentMap", "(Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/function/BinaryOperator;Ljava/util/function/Supplier;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "K", "U", "M extends java.util.concurrent.ConcurrentMap<K, U>" })>]
static member ToConcurrentMap : Java.Util.Functions.IFunction * Java.Util.Functions.IFunction * Java.Util.Functions.IBinaryOperator * Java.Util.Functions.ISupplier -> Java.Util.Streams.ICollector
Parameters
- keyMapper
- IFunction
a mapping function to produce keys
- valueMapper
- IFunction
a mapping function to produce values
- mergeFunction
- IBinaryOperator
a merge function, used to resolve collisions between
values associated with the same key, as supplied
to Map#merge(Object, Object, BiFunction)
- mapFactory
- ISupplier
a supplier providing a new empty ConcurrentMap
into which the results will be inserted
Returns
a concurrent, unordered Collector
which collects elements into a
ConcurrentMap
whose keys are the result of applying a key mapping
function to the input elements, and whose values are the result of
applying a value mapping function to all input elements equal to the key
and combining them using the merge function
- Attributes
Remarks
Returns a concurrent Collector
that accumulates elements into a ConcurrentMap
whose keys and values are the result of applying the provided mapping functions to the input elements.
If the mapped keys contain duplicates (according to Object#equals(Object)
), the value mapping function is applied to each equal element, and the results are merged using the provided merging function. The ConcurrentMap
is created by a provided supplier function.
This is a Collector.Characteristics#CONCURRENT concurrent
and Collector.Characteristics#UNORDERED unordered
Collector.
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
ToConcurrentMap(IFunction, IFunction)
Returns a concurrent Collector
that accumulates elements into a
ConcurrentMap
whose keys and values are the result of applying
the provided mapping functions to the input elements.
[Android.Runtime.Register("toConcurrentMap", "(Ljava/util/function/Function;Ljava/util/function/Function;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "K", "U" })]
public static Java.Util.Streams.ICollector? ToConcurrentMap (Java.Util.Functions.IFunction? keyMapper, Java.Util.Functions.IFunction? valueMapper);
[<Android.Runtime.Register("toConcurrentMap", "(Ljava/util/function/Function;Ljava/util/function/Function;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "K", "U" })>]
static member ToConcurrentMap : Java.Util.Functions.IFunction * Java.Util.Functions.IFunction -> Java.Util.Streams.ICollector
Parameters
- keyMapper
- IFunction
the mapping function to produce keys
- valueMapper
- IFunction
the mapping function to produce values
Returns
a concurrent, unordered Collector
which collects elements into a
ConcurrentMap
whose keys are the result of applying a key mapping
function to the input elements, and whose values are the result of
applying a value mapping function to the input elements
- Attributes
Remarks
Returns a concurrent Collector
that accumulates elements into a ConcurrentMap
whose keys and values are the result of applying the provided mapping functions to the input elements.
If the mapped keys contain duplicates (according to Object#equals(Object)
), an IllegalStateException
is thrown when the collection operation is performed. If the mapped keys may have duplicates, use #toConcurrentMap(Function, Function, BinaryOperator)
instead.
There are no guarantees on the type, mutability, or serializability of the ConcurrentMap
returned.
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
ToConcurrentMap(IFunction, IFunction, IBinaryOperator)
Returns a concurrent Collector
that accumulates elements into a
ConcurrentMap
whose keys and values are the result of applying
the provided mapping functions to the input elements.
[Android.Runtime.Register("toConcurrentMap", "(Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/function/BinaryOperator;)Ljava/util/stream/Collector;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "K", "U" })]
public static Java.Util.Streams.ICollector? ToConcurrentMap (Java.Util.Functions.IFunction? keyMapper, Java.Util.Functions.IFunction? valueMapper, Java.Util.Functions.IBinaryOperator? mergeFunction);
[<Android.Runtime.Register("toConcurrentMap", "(Ljava/util/function/Function;Ljava/util/function/Function;Ljava/util/function/BinaryOperator;)Ljava/util/stream/Collector;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "K", "U" })>]
static member ToConcurrentMap : Java.Util.Functions.IFunction * Java.Util.Functions.IFunction * Java.Util.Functions.IBinaryOperator -> Java.Util.Streams.ICollector
Parameters
- keyMapper
- IFunction
a mapping function to produce keys
- valueMapper
- IFunction
a mapping function to produce values
- mergeFunction
- IBinaryOperator
a merge function, used to resolve collisions between
values associated with the same key, as supplied
to Map#merge(Object, Object, BiFunction)
Returns
a concurrent, unordered Collector
which collects elements into a
ConcurrentMap
whose keys are the result of applying a key mapping
function to the input elements, and whose values are the result of
applying a value mapping function to all input elements equal to the key
and combining them using the merge function
- Attributes
Remarks
Returns a concurrent Collector
that accumulates elements into a ConcurrentMap
whose keys and values are the result of applying the provided mapping functions to the input elements.
If the mapped keys contain duplicates (according to Object#equals(Object)
), the value mapping function is applied to each equal element, and the results are merged using the provided merging function.
There are no guarantees on the type, mutability, or serializability of the ConcurrentMap
returned.
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.