T - the collection element typepublic class ImmutableListIterator<T> extends ImmutableIterator<T> implements ListIterator<T>
ListIterator to provide functionality for the immutable classes.| Constructor and Description |
|---|
ImmutableListIterator(T[] array,
int length,
int index)
Construct an
ImmutableListIterator with the given array and length, and with the given starting index. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T t)
Modifying operation - not allowed.
|
boolean |
hasPrevious()
Test whether the iterator has any preceding elements.
|
int |
nextIndex()
Get the index of the "next" element.
|
T |
previous()
Get the preceding element referenced by this
ImmutableIterator. |
int |
previousIndex()
Get the index of the previous element.
|
void |
remove()
Modifying operation - not allowed.
|
void |
set(T t)
Modifying operation - not allowed.
|
nextcheckNext, hasNextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasNext, nextforEachRemainingpublic ImmutableListIterator(T[] array, int length, int index)
ImmutableListIterator with the given array and length, and with the given starting index.array - the arraylength - the length (the number of array items to be considered part of the collection)index - the starting indexpublic boolean hasPrevious()
hasPrevious in interface ListIterator<T>true if there is at least one preceding element availablepublic T previous()
ImmutableIterator.previous in interface ListIterator<T>NoSuchElementException - if there is no preceding elementpublic int nextIndex()
nextIndex in interface ListIterator<T>public int previousIndex()
previousIndex in interface ListIterator<T>public void remove()
remove in interface Iterator<T>remove in interface ListIterator<T>UnsupportedOperationException - (in all cases)public void set(T t)
set in interface ListIterator<T>UnsupportedOperationException - (in all cases)public void add(T t)
add in interface ListIterator<T>UnsupportedOperationException - (in all cases)Copyright © 2023. All rights reserved.