Partager via


INavigableSet Interface

Definition

A SortedSet extended with navigation methods reporting closest matches for given search targets.

[Android.Runtime.Register("java/util/NavigableSet", "", "Java.Util.INavigableSetInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
public interface INavigableSet : IDisposable, Java.Interop.IJavaPeerable, Java.Util.ISortedSet
[<Android.Runtime.Register("java/util/NavigableSet", "", "Java.Util.INavigableSetInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "E" })>]
type INavigableSet = interface
    interface ISortedSet
    interface ISet
    interface ICollection
    interface IIterable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

A SortedSet extended with navigation methods reporting closest matches for given search targets. Methods #lower, #floor, #ceiling, and #higher return elements respectively less than, less than or equal, greater than or equal, and greater than a given element, returning null if there is no such element.

A NavigableSet may be accessed and traversed in either ascending or descending order. The #descendingSet method returns a view of the set 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. This interface additionally defines methods #pollFirst and #pollLast that return and remove the lowest and highest element, if one exists, else returning null. Methods #subSet(Object, boolean, Object, boolean) subSet(E, boolean, E, boolean), #headSet(Object, boolean) headSet(E, boolean), and #tailSet(Object, boolean) tailSet(E, boolean) differ from the like-named SortedSet methods in accepting additional arguments describing whether lower and upper bounds are inclusive versus exclusive. Subsets of any NavigableSet must implement the NavigableSet interface.

The return values of navigation methods may be ambiguous in implementations that permit null elements. However, even in this case the result can be disambiguated by checking contains(null). To avoid such issues, implementations of this interface are encouraged to <em>not</em> permit insertion of null elements. (Note that sorted sets of Comparable elements intrinsically do not permit null.)

Methods #subSet(Object, Object) subSet(E, E), #headSet(Object) headSet(E), and #tailSet(Object) tailSet(E) are specified to return SortedSet to allow existing implementations of SortedSet to be compatibly retrofitted to implement NavigableSet, but extensions and implementations of this interface are encouraged to override these methods to return NavigableSet.

Added in 1.6.

Java documentation for java.util.NavigableSet.

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 true if this set has no elements.

(Inherited from ISet)
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

Add(Object)

Adds the specified element to this set if it is not already present (optional operation).

(Inherited from ISet)
AddAll(ICollection)

Adds all of the elements in the specified collection to this set if they're not already present (optional operation).

(Inherited from ISet)
Ceiling(Object)

Returns the least element in this set greater than or equal to the given element, or null if there is no such element.

Clear()

Removes all of the elements from this set (optional operation).

(Inherited from ISet)
Comparator()

Returns the comparator used to order the elements in this set, or null if this set uses the Comparable natural ordering of its elements.

(Inherited from ISortedSet)
Contains(Object)

Returns true if this set contains the specified element.

(Inherited from ISet)
ContainsAll(ICollection)

Returns true if this set contains all of the elements of the specified collection.

(Inherited from ISet)
DescendingIterator()

Returns an iterator over the elements in this set, in descending order.

DescendingSet()

Returns a reverse order view of the elements contained in this set.

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 set for equality.

(Inherited from ISet)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
First()

Returns the first (lowest) element currently in this set.

(Inherited from ISortedSet)
Floor(Object)

Returns the greatest element in this set less than or equal to the given element, or null if there is no such element.

ForEach(IConsumer)

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

(Inherited from IIterable)
GetHashCode()

Returns the hash code value for this set.

(Inherited from ISet)
HeadSet(Object, Boolean)

Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement.

HeadSet(Object)

To be added

Higher(Object)

Returns the least element in this set strictly greater than the given element, or null if there is no such element.

Iterator()

Returns an iterator over the elements in this set, in ascending order.

Last()

Returns the last (highest) element currently in this set.

(Inherited from ISortedSet)
Lower(Object)

Returns the greatest element in this set strictly less than the given element, or null if there is no such element.

PollFirst()

Retrieves and removes the first (lowest) element, or returns null if this set is empty.

PollLast()

Retrieves and removes the last (highest) element, or returns null if this set is empty.

Remove(Object)

Removes the specified element from this set if it is present (optional operation).

(Inherited from ISet)
RemoveAll(ICollection)

Removes from this set all of its elements that are contained in the specified collection (optional operation).

(Inherited from ISet)
RemoveIf(IPredicate)

Removes all of the elements of this collection that satisfy the given predicate.

(Inherited from ICollection)
RetainAll(ICollection)

Retains only the elements in this set that are contained in the specified collection (optional operation).

(Inherited from ISet)
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 elements in this set (its cardinality).

(Inherited from ISet)
Spliterator()

Creates a Spliterator over the elements described by this Iterable.

(Inherited from IIterable)
SubSet(Object, Boolean, Object, Boolean)

Returns a view of the portion of this set whose elements range from fromElement to toElement.

SubSet(Object, Object)

To be added

TailSet(Object, Boolean)

Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) fromElement.

TailSet(Object)

To be added

ToArray()

Returns an array containing all of the elements in this set.

(Inherited from ISet)
ToArray(IIntFunction)

Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.

(Inherited from ICollection)
ToArray(Object[])

Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.

(Inherited from ISet)
UnregisterFromRuntime()

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

(Inherited from IJavaPeerable)

Explicit Interface Implementations

IIterable.Spliterator()

Creates a Spliterator over the elements in this sorted set.

(Inherited from ISortedSet)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)
ToEnumerable(IIterable)
ToEnumerable<T>(IIterable)

Applies to