wt.util
Class EnumeratorVector

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended bywt.util.EnumeratorVector
All Implemented Interfaces:
Cloneable, Collection, Enumeration, List, RandomAccess, Serializable

public class EnumeratorVector
extends Vector
implements Enumeration

EnumeratorVector is wrapper class for java.util.Vector that implements java.util.Enumeration.

This class can be used when a Vector is called for and at the same time must be returned as an enumeration. The problem with returning Vector.elements () is that the class returned is not Serializable and therefore not appropriate for client-server communication.



Supported API: true

Extendable: false

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
EnumeratorVector()
          No-arg constructor.
EnumeratorVector(Vector v)
          Constructs and initializes to the vector 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.
 void reset()
          Resets the enumeration to its first element.
 
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

EnumeratorVector

public EnumeratorVector()
No-arg constructor. Sets the next element to be returned to be the firsrt in the wrapped vector.


EnumeratorVector

public EnumeratorVector(Vector v)
Constructs and initializes to the vector passed as argument.

Supported API: true

Method Detail

hasMoreElements

public boolean hasMoreElements()
Determines whether there are more elements to be returned.

Supported API: true

Specified by:
hasMoreElements in interface Enumeration
Returns:
true if there are more lements; 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).

Supported API: true

Specified by:
nextElement in interface Enumeration
Returns:
the next object in the enumeration
Throws:
NoSuchElementException - if there aren't objects to be returned.

reset

public void reset()
Resets the enumeration to its first element.

Supported API: true