Compartilhar via


ISequencedCollection Interface

Definition

A collection that has a well-defined encounter order, that supports operations at both ends, and that is reversible.

[Android.Runtime.Register("java/util/SequencedCollection", "", "Java.Util.ISequencedCollectionInvoker", ApiSince=35)]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
public interface ISequencedCollection : IDisposable, Java.Interop.IJavaPeerable, Java.Util.ICollection
[<Android.Runtime.Register("java/util/SequencedCollection", "", "Java.Util.ISequencedCollectionInvoker", ApiSince=35)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "E" })>]
type ISequencedCollection = interface
    interface ICollection
    interface IIterable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Derived
Attributes
Implements

Remarks

A collection that has a well-defined encounter order, that supports operations at both ends, and that is reversible. The elements of a sequenced collection have an "encounter"> <i>encounter order</i>, where conceptually the elements have a linear arrangement from the first element to the last element. Given any two elements, one element is either before (closer to the first element) or after (closer to the last element) the other element.

(Note that this definition does not imply anything about physical positioning of elements, such as their locations in a computer's memory.)

Several methods inherited from the Collection interface are required to operate on elements according to this collection's encounter order. For instance, the Collection#iterator iterator method provides elements starting from the first element, proceeding through successive elements, until the last element. Other methods that are required to operate on elements in encounter order include the following: Iterable#forEach forEach, Collection#parallelStream parallelStream, Collection#spliterator spliterator, Collection#stream stream, and all overloads of the Collection#toArray toArray method.

This interface provides methods to add, retrieve, and remove elements at either end of the collection.

This interface also defines the #reversed reversed method, which provides a reverse-ordered view of this collection. In the reverse-ordered view, the concepts of first and last are inverted, as are the concepts of successor and predecessor. The first element of this collection is the last element of the reverse-ordered view, and vice-versa. The successor of some element in this collection is its predecessor in the reversed view, and vice-versa. All methods that respect the encounter order of the collection operate as if the encounter order is inverted. For instance, the #iterator method of the reversed view reports the elements in order from the last element of this collection to the first. The availability of the reversed method, and its impact on the ordering semantics of all applicable methods, allow convenient iteration, searching, copying, and streaming of the elements of this collection in either forward order or reverse order.

This class is a member of the Java Collections Framework.

Added in 21.

Java documentation for java.util.SequencedCollection.

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 if this Collection contains no elements.

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

Ensures that this collection contains the specified element (optional operation).

(Inherited from ICollection)
AddAll(ICollection)

Adds all of the elements in the specified collection to this collection (optional operation).

(Inherited from ICollection)
AddFirst(Object)

Adds an element as the first element of this collection (optional operation).

AddLast(Object)

Adds an element as the last element of this collection (optional operation).

Clear()

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

(Inherited from ICollection)
Contains(Object)

Returns true if this collection contains the specified element.

(Inherited from ICollection)
ContainsAll(ICollection)

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

(Inherited from ICollection)
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 collection for equality.

(Inherited from ICollection)
Finalized()

Called when the instance has been finalized.

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

Gets the first element of this collection.

GetHashCode()

Returns the hash code value for this collection.

(Inherited from ICollection)
GetLast()

Gets the last element of this collection.

Iterator()

Returns an iterator over the elements in this collection.

(Inherited from ICollection)
Remove(Object)

Removes a single instance of the specified element from this collection, if it is present (optional operation).

(Inherited from ICollection)
RemoveAll(ICollection)

Removes all of this collection's elements that are also contained in the specified collection (optional operation).

(Inherited from ICollection)
RemoveFirst()

Removes and returns the first element of this collection (optional operation).

RemoveIf(IPredicate)

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

(Inherited from ICollection)
RemoveLast()

Removes and returns the last element of this collection (optional operation).

RetainAll(ICollection)

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

(Inherited from ICollection)
Reversed()

Returns a reverse-ordered view of this collection.

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 collection.

(Inherited from ICollection)
Spliterator()

Creates a Spliterator over the elements described by this Iterable.

(Inherited from IIterable)
ToArray()

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

(Inherited from ICollection)
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 collection; the runtime type of the returned array is that of the specified array.

(Inherited from ICollection)
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 collection.

(Inherited from ICollection)

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.

ToEnumerable(IIterable)
ToEnumerable<T>(IIterable)

Applies to