Lingua

Properties.ComputeIfAbsent(Object, IFunction) Metodo

Definizione

Calcola e archivia un valore solo quando questo oggetto non ha alcuna voce per la chiave.

[Android.Runtime.Register("computeIfAbsent", "(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;", "GetComputeIfAbsent_Ljava_lang_Object_Ljava_util_function_Function_Handler", ApiSince=35)]
public virtual Java.Lang.Object? ComputeIfAbsent(Java.Lang.Object? key, Java.Util.Functions.IFunction? mappingFunction);
[<Android.Runtime.Register("computeIfAbsent", "(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;", "GetComputeIfAbsent_Ljava_lang_Object_Ljava_util_function_Function_Handler", ApiSince=35)>]
abstract member ComputeIfAbsent : Java.Lang.Object * Java.Util.Functions.IFunction -> Java.Lang.Object
override this.ComputeIfAbsent : Java.Lang.Object * Java.Util.Functions.IFunction -> Java.Lang.Object

Parametri

key
Object

Chiave non Null da cercare o aggiungere.

mappingFunction
IFunction

Funzione non Null che calcola un valore dalla chiave assente.

Valori restituiti

Valore esistente o calcolato oppure null se la funzione non produce alcun valore.

Attributi

Commenti

Un risultato di funzione Null non viene archiviato. La funzione non deve modificare questa mappa durante il calcolo. Le voci nell'elenco delle proprietà predefinite non impediscono questo calcolo.

Si applica a