megamek.common
Class MMRandom.CryptoRandom

java.lang.Object
  extended by megamek.common.MMRandom
      extended by megamek.common.MMRandom.CryptoRandom
Enclosing class:
MMRandom

static class MMRandom.CryptoRandom
extends MMRandom

Uses java.security.SecureRandom


Nested Class Summary
 
Nested classes/interfaces inherited from class megamek.common.MMRandom
MMRandom.CryptoRandom, MMRandom.Pool36Random, MMRandom.SunRandom
 
Field Summary
(package private)  java.security.SecureRandom random
           
 
Fields inherited from class megamek.common.MMRandom
R_CRYPTO, R_DEFAULT, R_POOL36, R_SUN
 
Constructor Summary
MMRandom.CryptoRandom()
          Contruct, making a new thread to init the RNG
 
Method Summary
 int randomInt(int maxValue)
          Returns a random int in the range from 0 to one less than the supplied max value.
 
Methods inherited from class megamek.common.MMRandom
d6, d6, generate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

random

java.security.SecureRandom random
Constructor Detail

MMRandom.CryptoRandom

public MMRandom.CryptoRandom()
                      throws java.lang.NoSuchMethodException
Contruct, making a new thread to init the RNG

Throws:
java.lang.NoSuchMethodException
Method Detail

randomInt

public int randomInt(int maxValue)
Description copied from class: MMRandom
Returns a random int in the range from 0 to one less than the supplied max value.

Specified by:
randomInt in class MMRandom
Parameters:
maxValue - - the smallest int value which will exceed any random number returned by this method.
Returns:
a random int from the value set [0, maxValue).