org.ws4d.java.util
Class Math

java.lang.Object
  extended by org.ws4d.java.util.Math

public final class Math
extends java.lang.Object

Some maths functions missing on CLDC.


Constructor Summary
Math()
           
 
Method Summary
static java.util.Random getRandom()
          Returns the Random generated by MathUtil.
static int getRandomPortNumber()
          Generates a random port number between 1025 and 65535.
static int nextInt()
          Returns a random integer value.
static int nextInt(int max)
          Returns a random value in the range [0, max[.
static int nextInt(int min, int max)
          Returns a random value in the range [min, max[.
static int pow(int a, int b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Math

public Math()
Method Detail

nextInt

public static int nextInt(int min,
                          int max)
Returns a random value in the range [min, max[. When min == max, returns min. When min > max, returns nextInt(max, min).

Parameters:
min - The lower bound. Inclusive.
max - The upper bound. Exclusive.
Returns:
a random value in the range [min, max[.

nextInt

public static int nextInt(int max)
Returns a random value in the range [0, max[.

Parameters:
max - The upper bound. Exclusive.
Returns:
a random value in the range [0, max[.

nextInt

public static int nextInt()
Returns a random integer value.

Returns:
a random integer value.

getRandomPortNumber

public static int getRandomPortNumber()
Generates a random port number between 1025 and 65535.

Returns:
a random number to try as port number for the server.

getRandom

public static java.util.Random getRandom()
Returns the Random generated by MathUtil.

Returns:
Random;

pow

public static int pow(int a,
                      int b)