wt.util
Class SerialEnumeration

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended bywt.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

Nested Class Summary
 
Nested classes inherited from class java.util.AbstractList
 
Field Summary
private  int current
          Points to next object to be returned.
private static String versionID
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SerialEnumeration()
          No-arg constructor.
SerialEnumeration(Enumeration objEnum)
          Constructs and initializes to the enumeration passed as argument.
 
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
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

current

private int current
Points to next object to be returned.

Constructor Detail

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.

Method Detail

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.