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>

public class ArrayEnumeration<E> extends Object implements 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 Details

    • ArrayEnumeration

      public ArrayEnumeration(E[] array)
      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

      public E nextElement()
      Returns the next element in the enumeration.
      Specified by:
      nextElement in interface Enumeration<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:
      hasMoreElements in interface Enumeration<E>
      Returns:
      true if more elements exist