org.openejb.util
Class ArrayEnumeration

java.lang.Object
  extended by org.openejb.util.ArrayEnumeration
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.util.Enumeration

public final class ArrayEnumeration
extends java.lang.Object
implements java.util.Enumeration, java.io.Externalizable

An Externalizable Enumeration. Mainly used for returning enumerations from the finder methods in the home interface of entity beans.

Author:
David Blevins
See Also:
Serialized Form

Constructor Summary
ArrayEnumeration()
           
ArrayEnumeration(java.util.List list)
           
ArrayEnumeration(java.util.Vector elements)
           
 
Method Summary
 java.lang.Object get(int index)
           
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 java.lang.Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 void readExternal(java.io.ObjectInput in)
          The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.
 void set(int index, java.lang.Object o)
           
 int size()
           
 void writeExternal(java.io.ObjectOutput out)
          The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayEnumeration

public ArrayEnumeration(java.util.Vector elements)

ArrayEnumeration

public ArrayEnumeration(java.util.List list)

ArrayEnumeration

public ArrayEnumeration()
Method Detail

get

public java.lang.Object get(int index)

set

public void set(int index,
                java.lang.Object o)

size

public int size()

hasMoreElements

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

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

nextElement

public java.lang.Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
the next element of this enumeration.
Throws:
java.util.NoSuchElementException - if no more elements exist.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException - Includes any I/O exceptions that may occur

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.lang.ClassNotFoundException - If the class for an object being restored cannot be found.
java.io.IOException


Copyright © 1999-2011 OpenEJB. All Rights Reserved.