IListIterator Interface

Definition

An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list.

[Android.Runtime.Register("java/util/ListIterator", "", "Java.Util.IListIteratorInvoker")]
[Java.Interop.JavaTypeParameters(new System.String[] { "E" })]
public interface IListIterator : IDisposable, Java.Interop.IJavaPeerable, Java.Util.IIterator
[<Android.Runtime.Register("java/util/ListIterator", "", "Java.Util.IListIteratorInvoker")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "E" })>]
type IListIterator = interface
    interface IIterator
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Attributes
Implements

Remarks

An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list. A ListIterator has no current element; its cursor position always lies between the element that would be returned by a call to previous() and the element that would be returned by a call to next(). An iterator for a list of length n has n+1 possible cursor positions, as illustrated by the carets (^) below:

Element(0)   Element(1)   Element(2)   ... Element(n-1)
            cursor positions:  ^            ^            ^            ^                  ^

Note that the #remove and #set(Object) methods are not defined in terms of the cursor position; they are defined to operate on the last element returned by a call to #next or #previous().

This interface is a member of the Java Collections Framework.

Added in 1.2.

Java documentation for java.util.ListIterator.

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

Returns whether there are more elements to iterate.

HasPrevious

Returns whether there are previous elements to iterate.

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)

Inserts the specified element into the list (optional operation).

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)
Finalized()

Called when the instance has been finalized.

(Inherited from IJavaPeerable)
ForEachRemaining(IConsumer)

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

(Inherited from IIterator)
Next()

Returns the next element in the list and advances the cursor position.

NextIndex()

Returns the index of the element that would be returned by a subsequent call to #next.

Previous()

Returns the previous element in the list and moves the cursor position backwards.

PreviousIndex()

Returns the index of the element that would be returned by a subsequent call to #previous.

Remove()

Removes from the list the last element that was returned by #next or #previous (optional operation).

Set(Object)

Replaces the last element returned by #next or #previous with the specified element (optional operation).

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

Applies to