|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrafa.math.gen.FunctionStrategy
public class FunctionStrategy
Generates values according to a mathematical function.
| Field Summary | |
|---|---|
protected Function |
function
The function used to calculate values. |
| Constructor Summary | |
|---|---|
FunctionStrategy(java.lang.String f)
|
|
| Method Summary | |
|---|---|
java.util.List<? extends java.lang.Number> |
generate(int index)
Generates new numbers. |
java.util.Collection<Dependency> |
getDependencies(java.lang.Object dep)
Gets detailed information about the dependencies of this object on a given one. |
java.lang.String |
getFunction()
Getter for property function. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Currently, this class only listens to the NAME property of helper generators. |
void |
reset()
Resets the strategy to its initial state. |
void |
setFunction(java.lang.String f)
Sets the function of this generator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Function function
f(x),
x being the iteration of calculation (a non-negative integer).x
2*pi*x²
| Constructor Detail |
|---|
public FunctionStrategy(java.lang.String f)
throws CircularDependencyException
f - the function used to generate values
CircularDependencyException| Method Detail |
|---|
public void reset()
GeneratorStrategy
reset in interface GeneratorStrategy
public java.util.List<? extends java.lang.Number> generate(int index)
throws java.lang.Exception
GeneratorStrategy
generate in interface GeneratorStrategyindex - the index of the value within the strategy output. Note that
it can be ignored by the implementation, if not needed.
null if none was generated.
java.lang.Exception
public void setFunction(java.lang.String f)
throws CircularDependencyException
f - the function
CircularDependencyExceptionpublic java.lang.String getFunction()
public void propertyChange(java.beans.PropertyChangeEvent e)
NAME property of helper generators.
RESET of helpers has no effect,
as this object does not store any of their values.
propertyChange in interface java.beans.PropertyChangeListenerpublic java.util.Collection<Dependency> getDependencies(java.lang.Object dep)
Dependent
getDependencies in interface Dependentdep - the required object. If null, all of the
dependencies will be returned.
Dependency objects pointing to the same
object (target), or null if there is no
dependency on that object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||