org.openejb.util
Class ArrayEnumeration

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

public final class ArrayEnumeration
extends Object
implements Enumeration, Externalizable

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

See Also:
Serialized Form

Constructor Summary
ArrayEnumeration()
           
ArrayEnumeration(List list)
           
ArrayEnumeration(Vector elements)
           
 
Method Summary
 Object get(int index)
           
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 void readExternal(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, Object o)
           
 int size()
           
 void writeExternal(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(Vector elements)

ArrayEnumeration

public ArrayEnumeration(List list)

ArrayEnumeration

public ArrayEnumeration()
Method Detail

get

public Object get(int index)

set

public void set(int index,
                Object o)

size

public int size()

hasMoreElements

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

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

nextElement

public 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 Enumeration
Returns:
the next element of this enumeration.
Throws:
NoSuchElementException - if no more elements exist.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws 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 Externalizable
Throws:
IOException - Includes any I/O exceptions that may occur

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         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 Externalizable
Throws:
ClassNotFoundException - If the class for an object being restored cannot be found.
IOException


Copyright © 1999-2005 OpenEJB. All Rights Reserved.