Class ArrayEnumeration
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.demo.util.ArrayEnumeration
-
- All Implemented Interfaces:
Enumeration
public class ArrayEnumeration extends Object implements Enumeration
An enumeration that iterates over an array.- Author:
- Thomas Morgner
-
-
Constructor Summary
Constructors Constructor Description ArrayEnumeration(Object[] objectarray)Creates a new enumeration for the given array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasMoreElements()Returns true if this enumeration has at least one more Element.ObjectnextElement()Returns the next element in the Array.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
-
-
-
Constructor Detail
-
ArrayEnumeration
public ArrayEnumeration(Object[] objectarray)
Creates a new enumeration for the given array.- Parameters:
objectarray- the array over which to iterate- Throws:
NullPointerException- if the array is null.
-
-
Method Detail
-
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
public Object 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.
-
-