Compartilhar via


IConcurrentMap Interface

Definition

A Map providing thread safety and atomicity guarantees.

[Android.Runtime.Register("java/util/concurrent/ConcurrentMap", "", "Java.Util.Concurrent.IConcurrentMapInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })]
public interface IConcurrentMap : IDisposable, Java.Interop.IJavaPeerable, Java.Util.IMap
[<Android.Runtime.Register("java/util/concurrent/ConcurrentMap", "", "Java.Util.Concurrent.IConcurrentMapInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })>]
type IConcurrentMap = interface
    interface IMap
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

A Map providing thread safety and atomicity guarantees.

To maintain the specified guarantees, default implementations of methods including #putIfAbsent inherited from Map must be overridden by implementations of this interface. Similarly, implementations of the collections returned by methods #keySet, #values, and #entrySet must override methods such as removeIf when necessary to preserve atomicity guarantees.

Memory consistency effects: As with other concurrent collections, actions in a thread prior to placing an object into a ConcurrentMap as a key or value <i>happen-before</i> actions subsequent to the access or removal of that object from the ConcurrentMap in another thread.

This interface is a member of the Java Collections Framework.

Added in 1.5.

Java documentation for java.util.concurrent.ConcurrentMap.

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.

Properties

Handle

Gets the JNI value of the underlying Android object.

(Inherited from IJavaObject)
IsEmpty

Returns whether this map is empty.

(Inherited from IMap)
JniIdentityHashCode

Returns the value of java.lang.System.identityHashCode() for the wrapped instance.

(Inherited from IJavaPeerable)
JniManagedPeerState

State of the managed peer.

(Inherited from IJavaPeerable)
JniPeerMembers

Member access and invocation support.

(Inherited from IJavaPeerable)
PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)

Methods

Clear()

Removes all of the mappings from this map (optional operation).

(Inherited from IMap)
Compute(Object, IBiFunction)

Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).

(Inherited from IMap)
ComputeIfAbsent(Object, IFunction)

If the specified key is not already associated with a value (or is mapped to null), attempts to compute its value using the given mapping function and enters it into this map unless null.

(Inherited from IMap)
ComputeIfPresent(Object, IBiFunction)

If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.

(Inherited from IMap)
ContainsKey(Object)

Returns true if this map contains a mapping for the specified key.

(Inherited from IMap)
ContainsValue(Object)

Returns true if this map maps one or more keys to the specified value.

(Inherited from IMap)
Disposed()

Called when the instance has been disposed.

(Inherited from IJavaPeerable)
DisposeUnlessReferenced()

If there are no outstanding references to this instance, then calls Dispose(); otherwise, does nothing.

(Inherited from IJavaPeerable)
EntrySet()

Returns a Set view of the mappings contained in this map.

(Inherited from IMap)
Equals(Object)

Compares the specified object with this map for equality.

(Inherited from IMap)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
ForEach(IBiConsumer)

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.

(Inherited from IMap)
Get(Object)

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

(Inherited from IMap)
GetHashCode()

Returns the hash code value for this map.

(Inherited from IMap)
GetOrDefault(Object, Object)

Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.

(Inherited from IMap)
KeySet()

Returns a Set view of the keys contained in this map.

(Inherited from IMap)
Merge(Object, Object, IBiFunction)

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

(Inherited from IMap)
Put(Object, Object)

Associates the specified value with the specified key in this map (optional operation).

(Inherited from IMap)
PutAll(IDictionary)

Copies all of the mappings from the specified map to this map (optional operation).

(Inherited from IMap)
PutIfAbsent(Object, Object)

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

Remove(Object, Object)

Removes the entry for a key only if currently mapped to a given value.

Remove(Object)

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

(Inherited from IMap)
Replace(Object, Object, Object)

Replaces the entry for a key only if currently mapped to a given value.

Replace(Object, Object)

Replaces the entry for a key only if currently mapped to some value.

ReplaceAll(IBiFunction)

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.

(Inherited from IMap)
SetJniIdentityHashCode(Int32)

Set the value returned by JniIdentityHashCode.

(Inherited from IJavaPeerable)
SetJniManagedPeerState(JniManagedPeerStates) (Inherited from IJavaPeerable)
SetPeerReference(JniObjectReference)

Set the value returned by PeerReference.

(Inherited from IJavaPeerable)
Size()

Returns the number of key-value mappings in this map.

(Inherited from IMap)
UnregisterFromRuntime()

Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations.

(Inherited from IJavaPeerable)
Values()

Returns a Collection view of the values contained in this map.

(Inherited from IMap)

Explicit Interface Implementations

IMap.Compute(Object, IBiFunction)

To be added

IMap.ComputeIfAbsent(Object, IFunction)

To be added

IMap.ComputeIfPresent(Object, IBiFunction)

To be added

IMap.ForEach(IBiConsumer)

To be added

IMap.GetOrDefault(Object, Object)

To be added

IMap.Merge(Object, Object, IBiFunction)

To be added

IMap.ReplaceAll(IBiFunction)

To be added

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to