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 Details

    • 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 Details

    • hasMoreElements

      public boolean hasMoreElements()
      Returns true if this enumeration has at least one more Element.
      Specified by:
      hasMoreElements in interface Enumeration
      Returns:
      true, if there are more elements, false otherwise.
    • nextElement

      public Object nextElement()
      Returns the next element in the Array.
      Specified by:
      nextElement in interface Enumeration
      Returns:
      the next element in the array.
      Throws:
      NoSuchElementException - if no more elements exist.