All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.HashMapIterator

java.lang.Object
   |
   +----COM.objectspace.jgl.HashMapIterator

public final class HashMapIterator
extends Object
implements ForwardIterator
A HashMapIterator is a forward iterator that allows you to iterate through the contents of a HashMap. It has a mode that allows selection of the current position's key, value, or key-value pair.

See Also:
ForwardIterator

Variable Index

 o KEY
 o PAIR
 o VALUE

Constructor Index

 o HashMapIterator()
Construct myself to be an iterator with no associated data structure or position.
 o HashMapIterator(HashMapIterator)
Construct myself to be a copy of an existing iterator.

Method Index

 o advance()
Advance by one.
 o advance(int)
Advance by a specified amount.
 o atBegin()
Return true if I'm positioned at the first item of my input stream.
 o atEnd()
Return true if I'm positioned after the last item in my input stream.
 o clone()
Return a clone of myself.
 o distance(ForwardIterator)
Return the distance from myself to another iterator.
 o equals(HashMapIterator)
Return true if iterator is positioned at the same element as me.
 o equals(Object)
Return true if a specified object is the same kind of iterator as me and is positioned at the same element.
 o get()
Return the object at my current position.
 o getContainer()
Return my associated container.
 o hasMoreElements()
Return true if there are more elements in my input stream.
 o key()
Return the key of my current key/value pair.
 o nextElement()
Return the next element in my input stream.
 o put(Object)
Set the object at my current position to a specified value.
 o value()
Return the value of my current key/value pair.
 o value(Object)
Change the value of my current key/value pair.

Variables

 o PAIR
  public final static int PAIR
 o KEY
  public final static int KEY
 o VALUE
  public final static int VALUE

Constructors

 o HashMapIterator
  public HashMapIterator()
Construct myself to be an iterator with no associated data structure or position.

 o HashMapIterator
  public HashMapIterator(HashMapIterator iterator)
Construct myself to be a copy of an existing iterator.

Parameters:
iterator - The iterator to copy.

Methods

 o clone
  public Object clone()
Return a clone of myself.

Overrides:
clone in class Object
 o equals
  public boolean equals(Object object)
Return true if a specified object is the same kind of iterator as me and is positioned at the same element.

Parameters:
object - Any object.
Overrides:
equals in class Object
 o equals
  public boolean equals(HashMapIterator iterator)
Return true if iterator is positioned at the same element as me.

Parameters:
iterator - The iterator to compare myself against.
 o atBegin
  public boolean atBegin()
Return true if I'm positioned at the first item of my input stream.

 o atEnd
  public boolean atEnd()
Return true if I'm positioned after the last item in my input stream.

 o hasMoreElements
  public boolean hasMoreElements()
Return true if there are more elements in my input stream.

 o advance
  public void advance()
Advance by one.

 o advance
  public void advance(int n)
Advance by a specified amount.

Parameters:
n - The amount to advance.
 o nextElement
  public Object nextElement()
Return the next element in my input stream.

 o get
  public Object get()
Return the object at my current position.

 o put
  public void put(Object object)
Set the object at my current position to a specified value.

Parameters:
object - The object to be written at my current position.
 o key
  public Object key()
Return the key of my current key/value pair.

 o value
  public Object value()
Return the value of my current key/value pair.

 o value
  public void value(Object value)
Change the value of my current key/value pair.

Parameters:
object - The new value.
 o distance
  public int distance(ForwardIterator iterator)
Return the distance from myself to another iterator. I should be before the specified iterator.

Parameters:
iterator - The iterator to compare myself against.
 o getContainer
  public Container getContainer()
Return my associated container.


All Packages  Class Hierarchy  This Package  Previous  Next  Index