cz.cuni.jagrlib
Class IntMap.CommonIterator

java.lang.Object
  extended by cz.cuni.jagrlib.IntTuple<T>
      extended by cz.cuni.jagrlib.IntMap.CommonIterator
Direct Known Subclasses:
IntMap.TargetIterator, IntMap.TupleIterator
Enclosing class:
IntMap<T>

protected class IntMap.CommonIterator
extends IntTuple<T>

Common iterator ancestor.


Field Summary
protected  int i
          Last used position in keys array.
protected  int[] keys
          Copy of the map keys.
protected  int nextKey
          Next key to be used in next().
protected  boolean nextValid
          Is nextKey variable valid?
protected  T nextValue
          Next value to be used in next().
 
Fields inherited from class cz.cuni.jagrlib.IntTuple
key, value
 
Constructor Summary
protected IntMap.CommonIterator()
          Backs up map keys for this iterator.
 
Method Summary
protected  boolean findNext()
          Finds the next map key (nextKey) and returns true if successful.
 boolean hasNext()
          Part of the Iterator interface.
 void remove()
          Part of the Iterator interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keys

protected int[] keys
Copy of the map keys.


i

protected int i
Last used position in keys array. Should be incremented in next().


nextKey

protected int nextKey
Next key to be used in next(). findNext() sets it.


nextValue

protected T nextValue
Next value to be used in next(). findNext() sets it.


nextValid

protected boolean nextValid
Is nextKey variable valid?

Constructor Detail

IntMap.CommonIterator

protected IntMap.CommonIterator()
Backs up map keys for this iterator. No subsequent map changes will be reflected!

Method Detail

findNext

protected boolean findNext()
Finds the next map key (nextKey) and returns true if successful.


hasNext

public boolean hasNext()
Part of the Iterator interface.


remove

public void remove()
Part of the Iterator interface.