|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rafa.math.gen.DiscontinuousFunctionStrategy
public class DiscontinuousFunctionStrategy
This engine returns values taken from a list of fragments taken from number
generators, in an ordered way.
The length of the last fragment does not limit the ability to generate more
values, as the last generator will be used to that end.
Objects of this class can detect changes in the provider generators.
Constructor Summary | |
---|---|
DiscontinuousFunctionStrategy()
|
Method Summary | |
---|---|
DiscontinuousFunctionStrategy |
addFragment(java.lang.Integer index,
NumberGeneratorFragment fragment)
Adds a series of values from other generator to the list. |
protected GeneratorDependency |
buildDependency(NumberGeneratorFragment fragment,
int i)
Builds a dependency on a generator fragment. |
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.util.List<NumberGeneratorFragment> |
getFragments()
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
NumberGeneratorFragment |
removeFragment(int n)
Removes a fragment. |
boolean |
removeFragment(NumberGeneratorFragment fragment)
Removes a fragment. |
void |
reset()
Resets the strategy to its initial state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DiscontinuousFunctionStrategy()
Method Detail |
---|
public DiscontinuousFunctionStrategy addFragment(java.lang.Integer index, NumberGeneratorFragment fragment)
index
- TODOfragment
- the section of values to add from a generator
protected GeneratorDependency buildDependency(NumberGeneratorFragment fragment, int i)
fragment
- the generator fragment.i
- the index of the first dependent value.
public boolean removeFragment(NumberGeneratorFragment fragment)
fragment
- the fragment to remove
true
if it was successfuly removed,
false
otherwise.public NumberGeneratorFragment removeFragment(int n)
n
- the index of the fragment to remove.
public java.util.List<NumberGeneratorFragment> getFragments()
public java.util.List<? extends java.lang.Number> generate(int index) throws java.lang.Exception
GeneratorStrategy
generate
in interface GeneratorStrategy
index
- 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 reset()
GeneratorStrategy
reset
in interface GeneratorStrategy
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public java.util.Collection<Dependency> getDependencies(java.lang.Object dep)
Dependent
getDependencies
in interface Dependent
dep
- 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 |