public interface ObjectListIterator<K> extends ObjectBidirectionalIterator<K>, java.util.ListIterator<K>
ListIterator
.
This interface merges the methods provided by a ListIterator
and
a type-specific BidirectionalIterator
. Moreover, it provides
type-specific versions of add()
and set()
.
ListIterator
,
BidirectionalIterator
Modifier and Type | Method and Description |
---|---|
default void |
add(K k)
Inserts the specified element into the list (optional operation).
|
default void |
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
default void |
set(K k)
Replaces the last element returned by
Iterator.next() or
BidirectionalIterator.previous() with the specified element (optional operation). |
back, skip
hasPrevious, previous
default void set(K k)
Iterator.next()
or
BidirectionalIterator.previous()
with the specified element (optional operation).set
in interface java.util.ListIterator<K>
k
- the element used to replace the last element returned.
This default implementation just throws an UnsupportedOperationException
.
ListIterator.set(Object)
default void add(K k)
This default implementation just throws an UnsupportedOperationException
.
add
in interface java.util.ListIterator<K>
k
- the element to insert.ListIterator.add(Object)
default void remove()
This default implementation just throws an UnsupportedOperationException
.