uwcse.collections
Class SimpleOpenHashMap.SimpleKeyIterator

java.lang.Object
  |
  +--uwcse.collections.SimpleOpenHashMap.SimpleKeyIterator
All Implemented Interfaces:
SimpleIterator
Direct Known Subclasses:
SimpleOpenHashMap.SimpleValueIterator
Enclosing class:
SimpleOpenHashMap

class SimpleOpenHashMap.SimpleKeyIterator
extends java.lang.Object
implements SimpleIterator

This is an iterator over the keys of a hashtable. It lazily allocates current iterators for each bucket, until there are no more to allocate. This makes allocating the iterator very cheap, but advancing it somewhat more complicated.


Field Summary
(package private)  int bucket
           
(package private)  SimpleIterator iter
           
 
Constructor Summary
(package private) SimpleOpenHashMap.SimpleKeyIterator()
           
 
Method Summary
 java.lang.Object getItem(SimpleOpenHashMap.Entry e)
           
 boolean hasNext()
          Answer true iff there are more items to access.
 java.lang.Object next()
          Answer the current item AND advance the iterator to the next item.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bucket

int bucket

iter

SimpleIterator iter
Constructor Detail

SimpleOpenHashMap.SimpleKeyIterator

SimpleOpenHashMap.SimpleKeyIterator()
Method Detail

getItem

public java.lang.Object getItem(SimpleOpenHashMap.Entry e)

hasNext

public boolean hasNext()
Description copied from interface: SimpleIterator
Answer true iff there are more items to access.
Specified by:
hasNext in interface SimpleIterator

next

public java.lang.Object next()
Description copied from interface: SimpleIterator
Answer the current item AND advance the iterator to the next item.
Specified by:
next in interface SimpleIterator