public interface ObjectListIterator<K> extends ObjectBidirectionalIterator<K>, 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, skiphasPrevious, previousforEachRemaining, hasNext, nexthasNext, hasPrevious, next, nextIndex, previous, previousIndexdefault void set(K k)
Iterator.next() or
BidirectionalIterator.previous() with the specified element (optional operation).set in interface 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 ListIterator<K>k - the element to insert.ListIterator.add(Object)default void remove()
This default implementation just throws an UnsupportedOperationException.
remove in interface Iterator<K>remove in interface ListIterator<K>ListIterator.remove()