Package wt.util

Class EnumeratorVector

All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, Enumeration, List, RandomAccess

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:
  • Constructor Details

    • EnumeratorVector

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

      Supported API: true
  • Method Details

    • 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