Package io.microsphere.collection
Class ArrayEnumeration<E>
- java.lang.Object
-
- io.microsphere.collection.ArrayEnumeration<E>
-
- Type Parameters:
E
- the type of elements in the array
- All Implemented Interfaces:
java.util.Enumeration<E>
public class ArrayEnumeration<E> extends java.lang.Object implements java.util.Enumeration<E>
ArrayEnumeration
is an implementation of enumeration based on an array, used to sequentially access elements in the array.This class implements the
Enumeration
interface and is suitable for scenarios where read-only sequential access to array elements is required.Example Usage
String[] data = {"one", "two", "three"}; ArrayEnumeration<String> enumeration = new ArrayEnumeration<>(data); while (enumeration.hasMoreElements()) { System.out.println(enumeration.nextElement()); }
- Since:
- 1.0.0
- Author:
- Mercy
-
-
Constructor Summary
Constructors Constructor Description ArrayEnumeration(E[] elements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasMoreElements()
E
nextElement()
-
-
-
Constructor Detail
-
ArrayEnumeration
public ArrayEnumeration(E[] elements)
-
-