Uncommons Maths API
(Version 1.2.3)

org.uncommons.maths.random
Class DefaultSeedGenerator

java.lang.Object
  extended by org.uncommons.maths.random.DefaultSeedGenerator
All Implemented Interfaces:
SeedGenerator

public final class DefaultSeedGenerator
extends Object
implements SeedGenerator

Seed generator that maintains multiple strategies for seed generation and will delegate to the best one available for the current operating environment.

Author:
Daniel Dyer

Method Summary
 byte[] generateSeed(int length)
          Generates a seed by trying each of the available strategies in turn until one succeeds.
static DefaultSeedGenerator getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DefaultSeedGenerator getInstance()
Returns:
The singleton instance of this class.

generateSeed

public byte[] generateSeed(int length)
Generates a seed by trying each of the available strategies in turn until one succeeds. Tries the most suitable strategy first and eventually degrades to the least suitable (but guaranteed to work) strategy.

Specified by:
generateSeed in interface SeedGenerator
Parameters:
length - The length (in bytes) of the seed.
Returns:
A random seed of the requested length.

Uncommons Maths API
(Version 1.2.3)