com.Ostermiller.util Java Utilities


com.Ostermiller.util
Class ArrayEnumeration<ElementType>

java.lang.Object
  extended by com.Ostermiller.util.ArrayEnumeration<ElementType>
Type Parameters:
ElementType - Type of object enumerated
All Implemented Interfaces:
Enumeration<ElementType>

public class ArrayEnumeration<ElementType>
extends Object
implements Enumeration<ElementType>

Converts an array to an enumerator.

More information about this class is available from ostermiller.org.

Since:
ostermillerutils 1.03.00
Author:
Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities

Constructor Summary
ArrayEnumeration(ElementType[] array)
          Create an Enumeration from an Array.
 
Method Summary
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 ElementType nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayEnumeration

public ArrayEnumeration(ElementType[] array)
Create an Enumeration from an Array.

Parameters:
array - of objects on which to enumerate.
Since:
ostermillerutils 1.03.00
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface Enumeration<ElementType>
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.
Since:
ostermillerutils 1.03.00

nextElement

public ElementType nextElement()
                        throws NoSuchElementException
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface Enumeration<ElementType>
Returns:
the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.
Since:
ostermillerutils 1.03.00

com.Ostermiller.util Java Utilities


Copyright © 2001-2012 by Stephen Ostermiller