java.util
Class Hashtable.Enumerator

java.lang.Object
  |
  +--java.util.Hashtable.Enumerator

private class Hashtable.Enumerator
extends Object
implements Enumeration, Iterator

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.


Field Summary
(package private)  Hashtable.Entry entry
           
private  int expectedModCount
          The modCount value that the iterator believes that the backing List should have.
(package private)  int index
           
(package private)  boolean iterator
          Indicates whether this Enumerator is serving as an Iterator or an Enumeration.
(package private)  Hashtable.Entry lastReturned
           
(package private)  Hashtable.Entry[] table
           
(package private)  int type
           
 
Constructor Summary
(package private) Hashtable.Enumerator(int type, boolean iterator)
           
 
Method Summary
 boolean hasMoreElements()
           
 boolean hasNext()
           
 Object next()
           
 Object nextElement()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

table

Hashtable.Entry[] table

index

int index

entry

Hashtable.Entry entry

lastReturned

Hashtable.Entry lastReturned

type

int type

iterator

boolean iterator
Indicates whether this Enumerator is serving as an Iterator or an Enumeration. (true -> Iterator).

expectedModCount

private 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.
Constructor Detail

Hashtable.Enumerator

Hashtable.Enumerator(int type,
                     boolean iterator)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface Enumeration

nextElement

public Object nextElement()
Specified by:
nextElement in interface Enumeration

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator