Package wt.util
Class EnumeratorVector
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
wt.util.EnumeratorVector
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,Enumeration,List,RandomAccess
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:
-
Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstructs and initializes to the vector passed as argument. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines whether there are more elements to be returned.Returns the next element of the vector.voidreset()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, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.Enumeration
asIterator
-
Constructor Details
-
EnumeratorVector
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:
hasMoreElementsin interfaceEnumeration- Returns:
- true if there are more lements; false otherwise.
-
nextElement
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:
nextElementin interfaceEnumeration- 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
-