fr.jussieu.gla.wasa.util
Class RandomIterator

java.lang.Object
  |
  +--fr.jussieu.gla.wasa.util.RandomIterator

public class RandomIterator
extends java.lang.Object

Takes value randomly out of a List, int[] or Object[], ensuring that each element will be returned only once.

Version:
$Revision: 1.2 $ $Date: 2002/04/17 15:24:08 $
Author:
Laurent Caillette

Constructor Summary
RandomIterator(int[] values)
           
RandomIterator(java.util.List values)
           
RandomIterator(java.lang.Object[] values)
           
 
Method Summary
 boolean hasNext()
          Returns true if there is more elements in the RandomIterator.
 java.lang.Object next()
          Returns the next Object.
 int nextInt()
          Returns the next int.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomIterator

public RandomIterator(int[] values)

RandomIterator

public RandomIterator(java.lang.Object[] values)

RandomIterator

public RandomIterator(java.util.List values)
Method Detail

hasNext

public boolean hasNext()
Returns true if there is more elements in the RandomIterator.
Returns:
true if there is more elements in the RandomIterator, false else.

next

public java.lang.Object next()
Returns the next Object.
Returns:
The next Object.

nextInt

public int nextInt()
Returns the next int.
Returns:
The next int.