package ArrayGenerator;
import java.util.Arrays // in order to be able to use the fill(...) method
public class SimpleRandomCount extends RandomCount
{
/**
* Constructor
*/
public SimpleRandomCount(int size) {
super(size);
}
/**
* Randomise the array
*/
protected void randomise() {
int[] copy = new int[];
// used to indicate if elements have been used
boolean[] used = new boolean[array().length];
Arrays.fill(used,false);
for (int index = 0; index < array().length {
do {
randomIndex = randomIndex();
} while (used[randomIndex]);
copy[index] = array[randomIndex];
used[randomIndex] = True;
}
for (index < array().length; index++) {
array()[index] = copy[index];
}
} End of class SimpleRandomCount