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

Quick Search    Search Deep

java.util
Class Hashtable.ValueEnumerator  view Hashtable.ValueEnumerator download Hashtable.ValueEnumerator.java

java.lang.Object
  extended byjava.util.Hashtable.EntryEnumerator
      extended byjava.util.Hashtable.ValueEnumerator
All Implemented Interfaces:
Enumeration
Enclosing class:
Hashtable

private final class Hashtable.ValueEnumerator
extends Hashtable.EntryEnumerator

Enumeration view of this Hashtable, providing sequential access to its values. NOTE: Enumeration is not safe if new elements are put in the table as this could cause a rehash and we'd completely lose our place. Even without a rehash, it is undetermined if a new element added would appear in the enumeration. The spec says nothing about this, but the "Java Class Libraries" book implies that modifications to the hashtable during enumeration causes indeterminate results. Don't do it!


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)  Hashtable.HashEntry next
          Entry which will be returned by the next nextElement() call.
 
Constructor Summary
private Hashtable.ValueEnumerator()
           
 
Method Summary
 boolean hasMoreElements()
          Checks whether more elements remain in the enumeration.
 java.lang.Object nextElement()
          Returns the next element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

count

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


idx

int idx
Current index in the physical hash table.


next

Hashtable.HashEntry next
Entry which will be returned by the next nextElement() call. It is set if we are iterating through a bucket with multiple entries, or null if we must look in the next bucket.

Constructor Detail

Hashtable.ValueEnumerator

private Hashtable.ValueEnumerator()
Method Detail

nextElement

public java.lang.Object nextElement()
Returns the next element.

Specified by:
nextElement in interface Enumeration
Overrides:
nextElement in class Hashtable.EntryEnumerator

hasMoreElements

public boolean hasMoreElements()
Checks whether more elements remain in the enumeration.

Specified by:
hasMoreElements in interface Enumeration