rafa.math.gen
Class RandomStrategy

java.lang.Object
  extended by rafa.math.gen.RandomStrategy
All Implemented Interfaces:
GeneratorStrategy

public class RandomStrategy
extends java.lang.Object
implements GeneratorStrategy

This enging returns a random value.

Author:
rafa

Field Summary
protected  long seed
           
 
Constructor Summary
RandomStrategy()
           
RandomStrategy(long seed)
           
 
Method Summary
 java.util.List<? extends java.lang.Number> generate(int index)
          Generates new numbers.
 long getSeed()
           
 java.lang.Number getValue(int index)
          Deprecated. 
 void reset()
          Resets the strategy to its initial state.
 void setSeed(long seed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

seed

protected long seed
Constructor Detail

RandomStrategy

public RandomStrategy()

RandomStrategy

public RandomStrategy(long seed)
Method Detail

getValue

@Deprecated
public java.lang.Number getValue(int index)
Deprecated. 


generate

public java.util.List<? extends java.lang.Number> generate(int index)
                                                    throws java.lang.Exception
Description copied from interface: GeneratorStrategy
Generates new numbers.

Specified by:
generate in interface GeneratorStrategy
Parameters:
index - the index of the value within the strategy output. Note that it can be ignored by the implementation, if not needed.
Returns:
A list of numbers, or null if none was generated.
Throws:
java.lang.Exception

reset

public void reset()
Description copied from interface: GeneratorStrategy
Resets the strategy to its initial state.

Specified by:
reset in interface GeneratorStrategy

getSeed

public long getSeed()
Returns:

setSeed

public void setSeed(long seed)
Parameters:
seed -


Copyright © 2008-2009. All Rights Reserved.