Class ArrayEnumeration<E>
java.lang.Object
org.episteme.social.history.calendars.ArrayEnumeration<E>
- Type Parameters:
E- the type of elements in the array * @version 2.0
- All Implemented Interfaces:
Enumeration<E>
An
Enumeration implementation that wraps an array.
Provides a simple way to iterate over array elements using the legacy Enumeration interface.- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionArrayEnumeration(E[] array) Creates a new ArrayEnumeration for the specified array. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if there are more elements to enumerate.Returns the next element in the enumeration.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Enumeration
asIterator
-
Constructor Details
-
ArrayEnumeration
Creates a new ArrayEnumeration for the specified array.- Parameters:
array- the array to enumerate (must not be null)- Throws:
NullPointerException- if array is null
-
-
Method Details
-
nextElement
Returns the next element in the enumeration.- Specified by:
nextElementin interfaceEnumeration<E>- Returns:
- the next element
- Throws:
NoSuchElementException- if no more elements exist
-
hasMoreElements
public boolean hasMoreElements()Checks if there are more elements to enumerate.- Specified by:
hasMoreElementsin interfaceEnumeration<E>- Returns:
- true if more elements exist
-