rafa.math.gen
Class ConstantStrategy

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

public class ConstantStrategy
extends java.lang.Object
implements GeneratorStrategy

This engine returns a constant value.

Author:
rafa

Constructor Summary
ConstantStrategy(java.lang.Number value)
          Default constructor.
 
Method Summary
 java.util.List<? extends java.lang.Number> generate(int index)
          Generates new numbers.
 java.lang.Number getValue()
           
 void reset()
          Resets the strategy to its initial state.
 void setValue(java.lang.Number value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantStrategy

public ConstantStrategy(java.lang.Number value)
Default constructor.

Parameters:
value -
Method Detail

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

getValue

public java.lang.Number getValue()
Returns:

setValue

public void setValue(java.lang.Number value)
Parameters:
value -

reset

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

Specified by:
reset in interface GeneratorStrategy


Copyright © 2008-2009. All Rights Reserved.