de.grogra.blocks.arrangeBlock
Class SeedGenerator

java.lang.Object
  extended by de.grogra.blocks.arrangeBlock.SeedGenerator
All Implemented Interfaces:
DiscreteGenerator, Seedable

public class SeedGenerator
extends java.lang.Object
implements DiscreteGenerator

A SeedGenerator is a DiscreteGenerator which produces well-spaced seeds according to its spacing attribute. It relies on a RandomGenerator


Constructor Summary
SeedGenerator()
           
SeedGenerator(long seed, int spacing)
           
 
Method Summary
 long getSeed()
          Get the random number generator's seed.
 void reseed()
          Get another seed well-spaced (from the default SeedGenerator)
 long sample()
           
 void setSeed(long seed)
          Set the random number generator's seed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeedGenerator

public SeedGenerator()

SeedGenerator

public SeedGenerator(long seed,
                     int spacing)
Method Detail

getSeed

public long getSeed()
Description copied from interface: Seedable
Get the random number generator's seed.

Specified by:
getSeed in interface Seedable
Returns:
The generator's seed

reseed

public void reseed()
Description copied from interface: Seedable
Get another seed well-spaced (from the default SeedGenerator)

Specified by:
reseed in interface Seedable

sample

public long sample()
Specified by:
sample in interface DiscreteGenerator

setSeed

public void setSeed(long seed)
Description copied from interface: Seedable
Set the random number generator's seed.

Specified by:
setSeed in interface Seedable
Parameters:
seed - The new seed for the generator