wt.util
Class SerialEnumeration
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.Vector
wt.util.SerialEnumeration
- All Implemented Interfaces:
- Cloneable, Collection, Enumeration, List, RandomAccess, Serializable
- public class SerialEnumeration
- extends Vector
- implements Enumeration
SerialEnumeration
is wrapper class for java.util.Vector
that implements java.util.Enumeration
. It is intended to be used
to create Serializable Enumerations from non-Serializable Enumerations.
The problem with returning non-Serializable Enumerations is that
they are not appropriate for client-server communication.
- See Also:
Vector
,
Enumeration
,
Serializable
,
Serialized Form
Method Summary |
boolean |
hasMoreElements()
Determines whether there are more elements to be returned. |
Object |
nextElement()
Returns the next element of the vector. |
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
versionID
private static final String versionID
- See Also:
- Constant Field Values
current
private int current
- Points to next object to be returned.
SerialEnumeration
public SerialEnumeration()
- No-arg constructor. Sets the next element to be returned to be the firsrt in the
wrapped vector.
SerialEnumeration
public SerialEnumeration(Enumeration objEnum)
- Constructs and initializes to the enumeration passed as argument.
hasMoreElements
public boolean hasMoreElements()
- Determines whether there are more elements to be returned.
- Specified by:
hasMoreElements
in interface Enumeration
- Returns:
- true if there are more elements; false otherwise.
nextElement
public Object nextElement()
throws NoSuchElementException
- Returns the next element of the vector. Objects are returned in the order
they are added to the vector (FIFO).
- Specified by:
nextElement
in interface Enumeration
- Returns:
- the next object in the enumeration
- Throws:
NoSuchElementException
- if there aren't objects to be returned.