INavigableMap Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A SortedMap
extended with navigation methods returning the
closest matches for given search targets.
[Android.Runtime.Register("java/util/NavigableMap", "", "Java.Util.INavigableMapInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })]
public interface INavigableMap : IDisposable, Java.Interop.IJavaPeerable, Java.Util.ISortedMap
[<Android.Runtime.Register("java/util/NavigableMap", "", "Java.Util.INavigableMapInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "K", "V" })>]
type INavigableMap = interface
interface ISortedMap
interface IMap
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Derived
- Attributes
- Implements
Remarks
A SortedMap
extended with navigation methods returning the closest matches for given search targets. Methods #lowerEntry
, #floorEntry
, #ceilingEntry
, and #higherEntry
return Map.Entry
objects associated with keys respectively less than, less than or equal, greater than or equal, and greater than a given key, returning null
if there is no such key. Similarly, methods #lowerKey
, #floorKey
, #ceilingKey
, and #higherKey
return only the associated keys. All of these methods are designed for locating, not traversing entries.
A NavigableMap
may be accessed and traversed in either ascending or descending key order. The #descendingMap
method returns a view of the map with the senses of all relational and directional methods inverted. The performance of ascending operations and views is likely to be faster than that of descending ones. Methods #subMap(Object, boolean, Object, boolean) subMap(K, boolean, K, boolean)
, #headMap(Object, boolean) headMap(K, boolean)
, and #tailMap(Object, boolean) tailMap(K, boolean)
differ from the like-named SortedMap
methods in accepting additional arguments describing whether lower and upper bounds are inclusive versus exclusive. Submaps of any NavigableMap
must implement the NavigableMap
interface.
This interface additionally defines methods #firstEntry
, #pollFirstEntry
, #lastEntry
, and #pollLastEntry
that return and/or remove the least and greatest mappings, if any exist, else returning null
.
Implementations of entry-returning methods are expected to return Map.Entry
pairs representing snapshots of mappings at the time they were produced, and thus generally do <em>not</em> support the optional Entry.setValue
method. Note however that it is possible to change mappings in the associated map using method put
.
Methods #subMap(Object, Object) subMap(K, K)
, #headMap(Object) headMap(K)
, and #tailMap(Object) tailMap(K)
are specified to return SortedMap
to allow existing implementations of SortedMap
to be compatibly retrofitted to implement NavigableMap
, but extensions and implementations of this interface are encouraged to override these methods to return NavigableMap
. Similarly, #keySet()
can be overridden to return NavigableSet
.
Added in 1.6.
Java documentation for java.util.NavigableMap
.
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 |
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
CeilingEntry(Object) |
Returns a key-value mapping associated with the least key
greater than or equal to the given key, or |
CeilingKey(Object) |
Returns the least key greater than or equal to the given key,
or |
Clear() |
Removes all of the mappings from this map (optional operation). (Inherited from IMap) |
Comparator() |
Returns the comparator used to order the keys in this map, or
|
Compute(Object, IBiFunction) |
Attempts to compute a mapping for the specified key and its current
mapped value (or |
ComputeIfAbsent(Object, IFunction) |
If the specified key is not already associated with a value (or is mapped
to |
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 |
ContainsValue(Object) |
Returns |
DescendingKeySet() |
Returns a reverse order |
DescendingMap() |
Returns a reverse order view of the mappings contained in this map. |
Disposed() |
Called when the instance has been disposed. (Inherited from IJavaPeerable) |
DisposeUnlessReferenced() |
If there are no outstanding references to this instance, then
calls |
EntrySet() |
Returns a |
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) |
FirstEntry() |
Returns a key-value mapping associated with the least
key in this map, or |
FirstKey() |
Returns the first (lowest) key currently in this map. (Inherited from ISortedMap) |
FloorEntry(Object) |
Returns a key-value mapping associated with the greatest key
less than or equal to the given key, or |
FloorKey(Object) |
Returns the greatest key less than or equal to the given key,
or |
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 |
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
|
HeadMap(Object, Boolean) |
Returns a view of the portion of this map whose keys are less than (or
equal to, if |
HeadMap(Object) |
To be added |
HigherEntry(Object) |
Returns a key-value mapping associated with the least key
strictly greater than the given key, or |
HigherKey(Object) |
Returns the least key strictly greater than the given key, or
|
KeySet() |
Returns a |
LastEntry() |
Returns a key-value mapping associated with the greatest
key in this map, or |
LastKey() |
Returns the last (highest) key currently in this map. (Inherited from ISortedMap) |
LowerEntry(Object) |
Returns a key-value mapping associated with the greatest key
strictly less than the given key, or |
LowerKey(Object) |
Returns the greatest key strictly less than the given key, or
|
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) |
NavigableKeySet() |
Returns a |
PollFirstEntry() |
Removes and returns a key-value mapping associated with
the least key in this map, or |
PollLastEntry() |
Removes and returns a key-value mapping associated with
the greatest key in this map, or |
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 (or is mapped
to |
Remove(Object, Object) |
Removes the entry for the specified key only if it is currently mapped to the specified value. (Inherited from IMap) |
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 the specified key only if currently mapped to the specified value. (Inherited from IMap) |
Replace(Object, Object) |
Replaces the entry for the specified key only if it is currently mapped to some value. (Inherited from IMap) |
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 |
SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from IJavaPeerable) |
SetPeerReference(JniObjectReference) |
Set the value returned by |
Size() |
Returns the number of key-value mappings in this map. (Inherited from IMap) |
SubMap(Object, Boolean, Object, Boolean) |
Returns a view of the portion of this map whose keys range from
|
SubMap(Object, Object) |
To be added |
TailMap(Object, Boolean) |
Returns a view of the portion of this map whose keys are greater than (or
equal to, if |
TailMap(Object) |
To be added |
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 |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |