T
- Type of elementspublic class EnumerationIterator<T>
extends java.lang.Object
implements java.util.Enumeration<T>, java.util.Iterator<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.Enumeration<T> |
enumeration
Base enumeration
|
private java.util.Iterator<T> |
iterator
Base iterator
|
Constructor and Description |
---|
EnumerationIterator(java.util.Enumeration<T> enumeration)
Constructs EnumerationIterator
With an enumeration |
EnumerationIterator(java.util.Iterator<T> iterator)
Constructs EnumerationIterator
With iterator |
EnumerationIterator(T... array)
Constructs EnumerationIterator
With array |
Modifier and Type | Method and Description |
---|---|
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
|
java.util.Iterator<T> |
iterator()
Iterator
|
T |
next()
Next element
|
T |
nextElement()
Next element
|
void |
remove()
Does nothing
|
private int actualIndex
private T[] array
private java.util.Enumeration<T> enumeration
private java.util.Iterator<T> iterator
public EnumerationIterator(java.util.Enumeration<T> enumeration)
enumeration
- Base enumerationpublic EnumerationIterator(java.util.Iterator<T> iterator)
iterator
- Base iteratorpublic EnumerationIterator(T... array)
array
- Base arraypublic T getNextElement()
public boolean hasMoreElements()
hasMoreElements
in interface java.util.Enumeration<T>
true
if there a next elementEnumeration.hasMoreElements()
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
true
if there a next elementIterator.hasNext()
public boolean hasNextElement()
true
if there a next elementpublic java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
Iterable.iterator()
public T next()
next
in interface java.util.Iterator<T>
Iterator.next()
public T nextElement()
nextElement
in interface java.util.Enumeration<T>
Enumeration.nextElement()
public void remove()
remove
in interface java.util.Iterator<T>
Iterator.remove()