次の方法で共有


ConcurrentSkipListMap.Merge(Object, Object, IBiFunction) Method

Definition

If the specified key is not already associated with a value, associates it with the given value.

[Android.Runtime.Register("merge", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;", "GetMerge_Ljava_lang_Object_Ljava_lang_Object_Ljava_util_function_BiFunction_Handler", ApiSince=24)]
public virtual Java.Lang.Object? Merge (Java.Lang.Object? key, Java.Lang.Object? value, Java.Util.Functions.IBiFunction? remappingFunction);
[<Android.Runtime.Register("merge", "(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;", "GetMerge_Ljava_lang_Object_Ljava_lang_Object_Ljava_util_function_BiFunction_Handler", ApiSince=24)>]
abstract member Merge : Java.Lang.Object * Java.Lang.Object * Java.Util.Functions.IBiFunction -> Java.Lang.Object
override this.Merge : Java.Lang.Object * Java.Lang.Object * Java.Util.Functions.IBiFunction -> Java.Lang.Object

Parameters

key
Object

key with which the specified value is to be associated

value
Object

the value to use if absent

remappingFunction
IBiFunction

the function to recompute a value if present

Returns

the new value associated with the specified key, or null if none

Attributes

Remarks

If the specified key is not already associated with a value, associates it with the given value. Otherwise, replaces the value with the results of the given remapping function, or removes if null. The function is <em>NOT</em> guaranteed to be applied once atomically.

Added in 1.8.

Java documentation for java.util.concurrent.ConcurrentSkipListMap.merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>).

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