name.alessiosaltarin.utils
Class AxsRand

java.lang.Object
  extended by name.alessiosaltarin.utils.AxsRand

public class AxsRand
extends java.lang.Object

Random Numbers Generator

Since:
29/05/2001
Version:
1.0
Author:
Alessio Saltarin

Method Summary
static AxsRand getReference()
          Get reference to the singleton class AxsRand
static void main(java.lang.String[] args)
          Deprecated.  
 boolean randBoolean()
          Return a random true or false
 byte randByte()
          Returns a random number between 0 and 127
 byte randByte(byte b)
          Returns a random number between 0 and b-1 (with b <=127)
 char randChar()
          Returns a random char (between ASCII=32 and ASCII=132)
 double randDouble()
          Returns a random double number
 float randFloat()
          Returns a random float number
 int randInt(int maxint)
          Returns a random number between 0 and maxint-1
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getReference

public static AxsRand getReference()
Get reference to the singleton class AxsRand

Returns:
AxsRand object

randInt

public int randInt(int maxint)
Returns a random number between 0 and maxint-1

Parameters:
maxint - Maximum number allowed
Returns:
Random number between 1 and maxint

randByte

public byte randByte()
Returns a random number between 0 and 127

Returns:
random number between 0 and 127

randByte

public byte randByte(byte b)
Returns a random number between 0 and b-1 (with b <=127)

Parameters:
b - Maximum number to be generated
Returns:
random number between 0 and b-1 (with b <=127)

randFloat

public float randFloat()
Returns a random float number

Returns:
Random float number

randBoolean

public boolean randBoolean()
Return a random true or false

Returns:
random true or false

randDouble

public double randDouble()
Returns a random double number

Returns:
random double number

randChar

public char randChar()
Returns a random char (between ASCII=32 and ASCII=132)

Returns:
Random printable char

main

public static void main(java.lang.String[] args)
Deprecated. 

For test purposes only

Parameters:
args -

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net