KtMutableListIterator<T> class

An iterator over a mutable collection that supports indexed access. Provides the ability to add, modify and remove elements while iterating.

Implemented types

Constructors

KtMutableListIterator()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

add(T element) → void
Adds the specified element element into the underlying collection immediately before the element that would be returned by next, if any, and after the element that would be returned by previous, if any. (If the collection contains no elements, the new element becomes the sole element in the collection.) The new element is inserted before the implicit cursor: a subsequent call to next would be unaffected, and a subsequent call to previous would return the new element. (This call increases by one the value
that would be returned by a call to nextIndex or previousIndex.)
hasNext() bool
Returns true if the iteration has more elements. (In other words, returns true if [next} would return an element rather than throwing an exception.) [...]
inherited
hasPrevious() bool
Returns true if this list iterator has more elements when traversing the list in the reverse direction. (In other words, returns true if previous would return an element rather than throwing an exception.) [...]
inherited
next() → T
Returns the next element in the iteration. [...]
@nullable, inherited
nextIndex() int
Returns the index of the element that would be returned by a subsequent call to next. (Returns list size if the list iterator is at the end of the list.) [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
previous() → T
Returns the previous element in the list and moves the cursor position backwards. This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.) [...]
@nullable, inherited
previousIndex() int
Returns the index of the element that would be returned by a subsequent call to previous. (Returns -1 if the list iterator is at the beginning of the list.) [...]
inherited
remove() → void
Removes from the underlying collection the last element returned by this iterator.
inherited
set(T element) → void
Replaces the last element returned by next or previous with the specified element element.
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited