org.random.rjgodoy.trng
Enum FallbackPolicy

java.lang.Object
  extended by java.lang.Enum<FallbackPolicy>
      extended by org.random.rjgodoy.trng.FallbackPolicy
All Implemented Interfaces:
Serializable, Comparable<FallbackPolicy>

public enum FallbackPolicy
extends Enum<FallbackPolicy>

Values for the org.random.rjgodoy.trng.fallback property.

When the quota is exhausted, the generator may fallback to use a local PRNG, or it may wait (several minutes) until the quota is positive again.

Author:
Javier Godoy

Enum Constant Summary
PRNG
          The RNG will return true random numbers from the remote source if the quota is positive, and will use a local PRNG if the quota is negative.
TRNG
          The RNG will return true random numbers from the remote source if the quota is positive, and will sleep if the quota is negative.
 
Method Summary
static FallbackPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static FallbackPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TRNG

public static final FallbackPolicy TRNG
The RNG will return true random numbers from the remote source if the quota is positive, and will sleep if the quota is negative.


PRNG

public static final FallbackPolicy PRNG
The RNG will return true random numbers from the remote source if the quota is positive, and will use a local PRNG if the quota is negative.

The PRNG must be seed by the application code, by calling SecureRandom.setSeed(byte[]) on the instantiated SecureRandom object.

Method Detail

values

public static FallbackPolicy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FallbackPolicy c : FallbackPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FallbackPolicy valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Submit a bug or request a featureCopyright © (2008-2011) Roberto Javier Godoy
Project Web Hosted by SourceForge.netSouceForge.net is registered trademark of SourceForge, Inc., in the United States and other countries.