sudoku
Class Chooser

java.lang.Object
  extended by sudoku.Chooser

public class Chooser
extends java.lang.Object

The Chooser class is just a singleton random number generator. We don't want to create a new Random object every time we want a random number.


Method Summary
static Chooser getChooser()
          Static method which returns the (singleton) Chooser object.
 java.util.Random getRandom()
          Getter for the Random object, so any java.util.Random method can be used.
 int nextInt(int i)
          Create a random integer between 0 (inclusive) and i (exclusive).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getChooser

public static Chooser getChooser()
Static method which returns the (singleton) Chooser object.

Returns:
the Chooser object

getRandom

public java.util.Random getRandom()
Getter for the Random object, so any java.util.Random method can be used.

Returns:
the sole Random object

nextInt

public int nextInt(int i)
Create a random integer between 0 (inclusive) and i (exclusive).

Parameters:
i -
Returns:
the random integer