Language

LinkedHashMap.PutLast(Object, Object) Method

Definition

Inserts the given mapping into the map if it is not already present, or replaces the value of a mapping if it is already present (optional operation).

[Android.Runtime.Register("putLast", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetPutLast_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=35)]
public virtual Java.Lang.Object? PutLast(Java.Lang.Object? k, Java.Lang.Object? v);
[<Android.Runtime.Register("putLast", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", "GetPutLast_Ljava_lang_Object_Ljava_lang_Object_Handler", ApiSince=35)>]
abstract member PutLast : Java.Lang.Object * Java.Lang.Object -> Java.Lang.Object
override this.PutLast : Java.Lang.Object * Java.Lang.Object -> Java.Lang.Object

Parameters

k
Object

the key

v
Object

the value

Returns

the value previously associated with k, or null if none

Implements

Attributes

Remarks

Inserts the given mapping into the map if it is not already present, or replaces the value of a mapping if it is already present (optional operation).

The mapping is placed last in encounter order. When a new mapping is added, an override of RemoveEldestEntry(IMapEntry) can remove the eldest mapping, which can be the new mapping.

If this map already contains a mapping for this key, the mapping is relocated if necessary so that it is last in encounter order.

Added in 21.

Java documentation for java.util.LinkedHashMap.putLast(K, V).

Java reference for java.util.LinkedHashMap.putLast.

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