org.openejb.util
Class ArrayEnumeration
java.lang.Object
|
+--org.openejb.util.ArrayEnumeration
- All Implemented Interfaces:
- java.util.Enumeration, java.io.Externalizable, java.io.Serializable
- 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.
- See Also:
- Serialized Form
Method Summary |
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 |
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 |
ArrayEnumeration
public ArrayEnumeration(java.util.Vector elements)
ArrayEnumeration
public ArrayEnumeration()
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.