java.lang.Object
io.github.mmm.base.collection.ArrayIterator<E>
- Type Parameters:
E- type of the elements to iterate.
- All Implemented Interfaces:
Enumeration<E>,Iterator<E>
Implementation of both
Iterator and Enumeration to iterate a given array. For performance the array
is NOT copied so please note that modifications of the array given at construction will directly be reflected by this
ArrayIterator.- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionArrayIterator(E[] array) The constructor.ArrayIterator(E[] array, int start, int end) The constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Enumeration
asIteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ArrayIterator
The constructor.- Parameters:
array- is the array to iterate/enumerate.
-
ArrayIterator
The constructor.- Parameters:
array- is the array to iterate/enumerate.start- is the index of the first item to iterate/enumerate inarray.end- is the index of the last item to iterate/enumerate inarray.
-
-
Method Details
-
hasMoreElements
public boolean hasMoreElements()- Specified by:
hasMoreElementsin interfaceEnumeration<E>
-
hasNext
public boolean hasNext() -
nextElement
- Specified by:
nextElementin interfaceEnumeration<E>
-
next
-
remove
public void remove()
-