ListIterator (Java SE 24 & JDK 24)
- Type Parameters:
E- the type of elements returned by this list iterator
- All Superinterfaces:
Iterator<E>
-
Method Summary
voidInserts the specified element into the list (optional operation).
booleanhasNext()Returns
trueif this list iterator has more elements when traversing the list in the forward direction.booleanReturns
trueif this list iterator has more elements when traversing the list in the reverse direction.next()Returns the next element in the list and advances the cursor position.
intReturns 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.
intReturns the index of the element that would be returned by a subsequent call to
previous().voidremove()Removes from the list the last element that was returned by
next()orprevious()(optional operation).voidReplaces the last element returned by
next()orprevious()with the specified element (optional operation).
-
Method Details
-
hasNext
-
next
-
hasPrevious
-
previous
-
nextIndex
-
previousIndex
-
remove
-
set
-
add
-