This class is not part of the public API.

Class: java.util.Hashtable.Enumerator<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: Implements:

Methods

  • Hashtable.Enumeratortop

    Hashtable.Enumerator(int type, boolean iterator)
    Google Code Search
    Stack Overflow
  • hasMoreElementstop

    public boolean hasMoreElements()
    Tests if this enumeration contains more elements.
    Return:
    @return true if and only if this enumeration object contains at least one more element to provide; false otherwise.
    Specified by:
    hasMoreElements from Enumeration<T>
    Google Code Search
    Stack Overflow
  • 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.)
    Return:
    @return true if the iterator has more elements.
    Specified by:
    hasNext from Iterator<T>
    Google Code Search
    Stack Overflow
  • 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.
    Return:
    @return the next element in the iteration.
    Specified by:
    next from Iterator<T>
    Google Code Search
    Stack Overflow
  • nextElementtop

    public T nextElement()
    Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
    Return:
    @return the next element of this enumeration.
    Specified by:
    nextElement from Enumeration<T>
    Google Code Search
    Stack Overflow
  • 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.
    Specified by:
    remove from Iterator<T>
    Google Code Search
    Stack Overflow

Fields

  • entry

    Hashtable.Entry<K, V> entry
  • expectedModCount

    protected int expectedModCount
    The 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 iterator
    Indicates whether this Enumerator is serving as an Iterator or an Enumeration. (true -> Iterator).
  • lastReturned

    Hashtable.Entry<K, V> lastReturned
  • table

    Hashtable.Entry[] table
  • type

    int type