Class ArrayEnumeration
java.lang.Object
org.pentaho.reporting.engine.classic.demo.util.ArrayEnumeration
- All Implemented Interfaces:
Enumeration
An enumeration that iterates over an array.
- Author:
- Thomas Morgner
-
Constructor Summary
ConstructorsConstructorDescriptionArrayEnumeration(Object[] objectarray) Creates a new enumeration for the given array. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this enumeration has at least one more Element.Returns the next element in the Array.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Enumeration
asIterator
-
Constructor Details
-
ArrayEnumeration
Creates a new enumeration for the given array.- Parameters:
objectarray- the array over which to iterate- Throws:
NullPointerException- if the array is null.
-
-
Method Details
-
hasMoreElements
public boolean hasMoreElements()Returns true if this enumeration has at least one more Element.- Specified by:
hasMoreElementsin interfaceEnumeration- Returns:
- true, if there are more elements, false otherwise.
-
nextElement
Returns the next element in the Array.- Specified by:
nextElementin interfaceEnumeration- Returns:
- the next element in the array.
- Throws:
NoSuchElementException- if no more elements exist.
-