T - Type of elementspublic class EnumerationListIterator<T>
extends java.lang.Object
implements java.util.Enumeration<T>, java.util.ListIterator<T>, java.lang.Iterable<T>
| Modifier and Type | Field and Description |
|---|---|
private int |
actualIndex
Index to run over iterator or enumeration
|
private T[] |
array
Base array
|
private java.util.ListIterator<T> |
iterator
Base iterator
|
| Constructor and Description |
|---|
EnumerationListIterator(int startIndex,
T... array)
Constructs EnumerationIterator
With array |
EnumerationListIterator(java.util.ListIterator<T> iterator)
Constructs EnumerationIterator
With iterator |
EnumerationListIterator(java.util.ListIterator<T> iterator,
int startIndex)
Create a new instance of EnumerationListIterator
With list iterator |
EnumerationListIterator(T... array)
Constructs EnumerationIterator
With array |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T e)
Add an element
Parent documentation: |
T |
getNextElement()
Next element
|
boolean |
hasMoreElements()
Indicates if there a next element
|
boolean |
hasNext()
Indicates if there a next element
|
boolean |
hasNextElement()
Indicates if there a next element
|
boolean |
hasPrevious()
Indicates if there are a previous element
Parent documentation: |
java.util.Iterator<T> |
iterator()
Iterator
|
T |
next()
Next element
|
T |
nextElement()
Next element
|
int |
nextIndex()
Next index
Parent documentation: |
T |
previous()
Previous element
Parent documentation: |
int |
previousIndex()
Previous index
Parent documentation: |
void |
remove()
Does nothing
|
void |
set(T e)
Does nothing
Parent documentation: |
private int actualIndex
private final T[] array
private final java.util.ListIterator<T> iterator
public EnumerationListIterator(int startIndex,
T... array)
startIndex - Index where start the iterationarray - Base arraypublic EnumerationListIterator(java.util.ListIterator<T> iterator)
iterator - Base iteratorpublic EnumerationListIterator(java.util.ListIterator<T> iterator, int startIndex)
iterator - Iterator sourcestartIndex - Index where start read the list iteratorpublic EnumerationListIterator(T... array)
array - Base arraypublic void add(T e)
add in interface java.util.ListIterator<T>e - Element to addListIterator.add(java.lang.Object)public T getNextElement()
public boolean hasMoreElements()
hasMoreElements in interface java.util.Enumeration<T>true if there a next elementEnumeration.hasMoreElements()public boolean hasNext()
public boolean hasNextElement()
true if there a next elementpublic boolean hasPrevious()
hasPrevious in interface java.util.ListIterator<T>true if there are a previous elementListIterator.hasPrevious()public java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T>Iterable.iterator()public T next()
public T nextElement()
nextElement in interface java.util.Enumeration<T>Enumeration.nextElement()public int nextIndex()
nextIndex in interface java.util.ListIterator<T>ListIterator.nextIndex()public T previous()
previous in interface java.util.ListIterator<T>ListIterator.previous()public int previousIndex()
previousIndex in interface java.util.ListIterator<T>ListIterator.previousIndex()public void remove()