com.agentfactory.cldc.scheduler
Class Rand

java.lang.Object
  extended by java.util.Random
      extended by com.agentfactory.cldc.scheduler.Rand
All Implemented Interfaces:
java.io.Serializable

public class Rand
extends java.util.Random

Rand was created because the standard CLDC Random class does not provide a nextInt(int) method, which is required in AFME.

Author:
Conor Muldoon
See Also:
Serialized Form

Constructor Summary
Rand()
          Creates an instance of Rand.
Rand(long seed)
          Creates an instance of Rand from the specified seed.
 
Method Summary
 int nextInt(int n)
          Returns a pseudorandom number between 0 (inclusive) and the specified number (exclusive).
 
Methods inherited from class java.util.Random
nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextLong, setSeed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rand

public Rand()
Creates an instance of Rand.


Rand

public Rand(long seed)
Creates an instance of Rand from the specified seed.

Parameters:
seed - the specified seed.
Method Detail

nextInt

public int nextInt(int n)
Returns a pseudorandom number between 0 (inclusive) and the specified number (exclusive).

Overrides:
nextInt in class java.util.Random
Parameters:
n - the specified upper limit.
Returns:
the generated pseudorandom number.