Dela via


IMap.Remove Method

Definition

Overloads

Remove(Object)

Removes the mapping for a key from this map if it is present (optional operation).

Remove(Object, Object)

Removes the entry for the specified key only if it is currently mapped to the specified value.

Remove(Object)

Removes the mapping for a key from this map if it is present (optional operation).

[Android.Runtime.Register("remove", "(Ljava/lang/Object;)Ljava/lang/Object;", "GetRemove_Ljava_lang_Object_Handler:Java.Util.IMapInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Lang.Object? Remove (Java.Lang.Object? key);
[<Android.Runtime.Register("remove", "(Ljava/lang/Object;)Ljava/lang/Object;", "GetRemove_Ljava_lang_Object_Handler:Java.Util.IMapInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member Remove : Java.Lang.Object -> Java.Lang.Object

Parameters

key
Object

key whose mapping is to be removed from the map

Returns

the previous value associated with key, or null if there was no mapping for key.

Attributes

Exceptions

if removing from this Map is not supported.

Remarks

Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that Objects.equals(key, k), that mapping is removed. (The map can contain at most one such mapping.)

Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

The map will not contain a mapping for the specified key once the call returns.

Java documentation for java.util.Map.remove(java.lang.Object).

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

Remove(Object, Object)

Removes the entry for the specified key only if it is currently mapped to the specified value.

[Android.Runtime.Register("remove", "(Ljava/lang/Object;Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Ljava_lang_Object_Handler:Java.Util.IMap, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)]
public virtual bool Remove (Java.Lang.Object? key, Java.Lang.Object? value);
[<Android.Runtime.Register("remove", "(Ljava/lang/Object;Ljava/lang/Object;)Z", "GetRemove_Ljava_lang_Object_Ljava_lang_Object_Handler:Java.Util.IMap, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=24)>]
abstract member Remove : Java.Lang.Object * Java.Lang.Object -> bool
override this.Remove : Java.Lang.Object * Java.Lang.Object -> bool

Parameters

key
Object

key with which the specified value is associated

value
Object

value expected to be associated with the specified key

Returns

true if the value was removed

Attributes

Remarks

Removes the entry for the specified key only if it is currently mapped to the specified value.

Added in 1.8.

Java documentation for java.util.Map.remove(java.lang.Object, java.lang.Object).

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