net.sf.josceleton.commons.util
Class RandomUtil

java.lang.Object
  extended by net.sf.josceleton.commons.util.RandomUtil

public final class RandomUtil
extends Object

Since:
0.4

Method Summary
static int generateWithinRange(int middle, int deviation)
          Generates a number within the given range.
static int randFromZeroToExclusive(int exclusiveMax)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

randFromZeroToExclusive

public static int randFromZeroToExclusive(int exclusiveMax)
Since:
0.4

generateWithinRange

public static int generateWithinRange(int middle,
                                      int deviation)
Generates a number within the given range. Example: middle = 50; deviation = 10; result will be = [40..60]

Parameters:
middle - fixed point
deviation - the number can be different from middle point
Returns:
a number max deviation away from middle
Since:
0.4


Copyright © 2011 Josceleton. All Rights Reserved.