Share via


IMapEntry Interface

Definition

A map entry (key-value pair).

[Android.Runtime.Register("java/util/Map$Entry", "", "Java.Util.IMapEntryInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })]
public interface IMapEntry : Android.Runtime.IJavaObject, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("java/util/Map$Entry", "", "Java.Util.IMapEntryInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })>]
type IMapEntry = interface
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

A map entry (key-value pair). The Entry may be unmodifiable, or the value may be modifiable if the optional setValue method is implemented. The Entry may be independent of any map, or it may represent an entry of the entry-set view of a map.

An Entry maintains a connection to its underlying map if the Entry was obtained by iterating the Map#entrySet view of a map, either explicitly by using an Iterator or implicitly via the enhanced for statement. This connection to the backing map is valid only during iteration of the entry-set view. During the iteration, if supported by the backing map, a change to an Entry's value via the Map.Entry#setValue setValue method will be visible in the backing map. The behavior of such an Entry is undefined outside of iteration of the map's entry-set view. It is also undefined if the backing map has been modified after the Entry was returned by the iterator, except through the setValue method. In addition, a change to the value of a mapping in the backing map might or might not be visible in the corresponding Entry of the entry-set view.

An Entry may also be obtained from a map's entry-set view by other means, for example, using the Set#parallelStream parallelStream, Set#stream stream, Set#spliterator spliterator methods, any of the Set#toArray toArray overloads, or by copying the entry-set view into another collection. It is unspecified whether the obtained Entry instances are connected to the underlying map, whether changes to such an Entry will affect the underlying the map and vice-versa, and whether such an Entry supports the optional Map.Entry#setValue setValue method.

In addition, an Entry may be obtained directly from a map, for example via calls to methods directly on the NavigableMap interface. An entry thus obtained is generally not connected to the map and is an unmodifiable snapshot of the mapping as of the time of the call. Such an Entry also does not generally support the setValue method.

An Entry obtained by direct construction of the AbstractMap.SimpleEntry or AbstractMap.SimpleImmutableEntry classes or from a call to the Map#entry Map.entry or Map.Entry#copyOf Map.Entry.copyOf methods is not connected to any map.

Added in 1.2.

Java documentation for java.util.Map.Entry.

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)
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)
Key

Returns the key.

PeerReference

Returns a JniObjectReference of the wrapped Java object instance.

(Inherited from IJavaPeerable)
Value

Returns the value.

Methods

ComparingByKey()

Returns a comparator that compares Map.Entry in natural order on key.

ComparingByKey(IComparator)

Returns a comparator that compares Map.Entry by key using the given Comparator.

ComparingByValue()

Returns a comparator that compares Map.Entry in natural order on value.

ComparingByValue(IComparator)

Returns a comparator that compares Map.Entry by value using the given Comparator.

CopyOf(IMapEntry)
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)
Equals(Object)

Compares the specified object with this entry for equality.

Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
GetHashCode()

Returns the hash code value for this map entry.

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)
SetValue(Object)

Replaces the value corresponding to this entry with the specified value (optional operation).

UnregisterFromRuntime()

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

(Inherited from IJavaPeerable)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to