Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class Hashtable.KeyIterator  view Hashtable.KeyIterator download Hashtable.KeyIterator.java

java.lang.Object
  extended byjava.util.Hashtable.EntryIterator
      extended byjava.util.Hashtable.KeyIterator
All Implemented Interfaces:
Iterator
Enclosing class:
Hashtable

private class Hashtable.KeyIterator
extends Hashtable.EntryIterator

A class which implements the Iterator interface and is used for iterating over keys in Hashtables.


Field Summary
(package private)  int count
          The number of elements remaining to be returned by next().
(package private)  int idx
          Current index in the physical hash table.
(package private)  int knownMod
          The number of modifications to the backing Hashtable that we know about.
(package private)  Hashtable.HashEntry last
          The last Entry returned by a next() call.
(package private)  Hashtable.HashEntry next
          The next entry that should be returned by next().
 
Constructor Summary
private Hashtable.KeyIterator()
           
 
Method Summary
 boolean hasNext()
          Returns true if the Iterator has more elements.
 java.lang.Object next()
          Returns the next element in the Iterator's sequential view.
 void remove()
          Removes from the backing Hashtable the last element which was fetched with the next() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

knownMod

int knownMod
The number of modifications to the backing Hashtable that we know about.


count

int count
The number of elements remaining to be returned by next().


idx

int idx
Current index in the physical hash table.


last

Hashtable.HashEntry last
The last Entry returned by a next() call.


next

Hashtable.HashEntry next
The next entry that should be returned by next(). It is set to something if we're iterating through a bucket that contains multiple linked entries. It is null if next() needs to find a new bucket.

Constructor Detail

Hashtable.KeyIterator

private Hashtable.KeyIterator()
Method Detail

next

public java.lang.Object next()
Returns the next element in the Iterator's sequential view.

Specified by:
next in interface Iterator
Overrides:
next in class Hashtable.EntryIterator

hasNext

public boolean hasNext()
Returns true if the Iterator has more elements.

Specified by:
hasNext in interface Iterator

remove

public void remove()
Removes from the backing Hashtable the last element which was fetched with the next() method.

Specified by:
remove in interface Iterator