Class: java.util.Hashtable.Enumerator<T>
- private class Hashtable.Enumerator<T>
- implements Enumeration<T>, Iterator<T>
A hashtable enumerator class. This class implements both the
Enumeration and Iterator interfaces, but individual instances
can be created with the Iterator methods disabled. This is necessary
to avoid unintentionally increasing the capabilities granted a user
by passing an Enumeration.
Inheritance
Superclass tree:- java.lang.Object
- java.util.Hashtable.Enumerator
- Enumeration<T>
- Iterator<T>
Methods
-
Hashtable.Enumeratortop
Hashtable.Enumerator(int type, boolean iterator) -
hasMoreElementstop
public boolean hasMoreElements()Tests if this enumeration contains more elements.- Specified by:
- hasMoreElements from Enumeration<T>
-
hasNexttop
public boolean hasNext()Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.) -
nexttop
public T next()Returns the next element in the iteration. Calling this method repeatedly until the java.util.Iterator.hasNext() method returns false will return each element in the underlying collection exactly once. -
nextElementtop
public T nextElement()Returns the next element of this enumeration if this enumeration object has at least one more element to provide.- Specified by:
- nextElement from Enumeration<T>
-
removetop
public void remove()Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
Fields
-
entry
-
expectedModCount
protected int expectedModCountThe modCount value that the iterator believes that the backing List should have. If this expectation is violated, the iterator has detected concurrent modification. -
index
int index -
iterator
boolean iteratorIndicates whether this Enumerator is serving as an Iterator or an Enumeration. (true -> Iterator). -
lastReturned
-
table
-
type
int type
