peersim.util
Interface IndexIterator

All Known Implementing Classes:
LinearIterator, RandPermutation, WeightedRandPerm

public interface IndexIterator

This class provides iterations over the set of integers [0...k-1].


Method Summary
 boolean hasNext()
          Returns true if next() can be called at least one more time.
 int next()
          Returns next index.
 void reset(int k)
          This resets the iteration.
 

Method Detail

reset

void reset(int k)
This resets the iteration. The set of integers will be 0,..,k-1.


next

int next()
Returns next index.


hasNext

boolean hasNext()
Returns true if next() can be called at least one more time. Note that next() can be called k times after reset(int).