|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgov.nist.microanalysis.EPQLibrary.Strategy
public class Strategy
Algorithms often depend on other algorithms during the computation. Sometimes it is desirable to interchange dependent algorithms. Strategy objects facilitate this. A Strategy is a mechanism for interchanging the algorithms which are used to compute a quantity. A Strategy is a one-to-one mapping between algorithm type (such as BackscatterFactor.class or MassAbsorptionCoefficient.class) and the algorithm implementing this algorithm-type (such as BackscatterFactor.Pouchou1991 or MassAbsorptionCoefficient.Chantler2005). Each instance of the AlgorithmClass understands what other types of AlgorithmClass it requires to perform its operations and can provide a list of the default algorithms as its default Strategy. The defaults algorithms can be overridden using the AlgorithmClass.apply(Strategy ) method. Strategy objects enforce consistency across a calculation.
| Constructor Summary | |
|---|---|
Strategy()
Constructs a Strategy |
|
| Method Summary | |
|---|---|
void |
addAlgorithm(java.lang.Class cls,
AlgorithmClass value)
Specify an implentation of an AlgorithmClass-derived abstract base class. |
void |
apply(Strategy st)
apply - For those Class objects in this Stragegy, assign the Class-to-AlgorithmClass mappings in the argument Strategy to this Strategy. |
java.lang.Object |
clone()
|
AlgorithmClass |
getAlgorithm(java.lang.Class cls)
Get the implentation of an AlgorithmClass-derived abstract base class. |
AlgorithmClass |
getAlgorithm(java.lang.String clsName)
Get the implentation of an AlgorithmClass-derived abstract base class from the name of the abstract base class. |
java.util.Collection |
listAlgorithmClasses()
Returns a list of the name of the defined AlgorithmClass types |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Strategy()
| Method Detail |
|---|
public java.util.Collection listAlgorithmClasses()
public java.lang.Object clone()
clone in class java.lang.Objectpublic void apply(Strategy st)
st -
public void addAlgorithm(java.lang.Class cls,
AlgorithmClass value)
cls - - One of AbsorptionCorrection.class, BackscatterFactor.class,
...value - - A class derived from the class specified in clspublic AlgorithmClass getAlgorithm(java.lang.Class cls)
cls -
public AlgorithmClass getAlgorithm(java.lang.String clsName)
clsName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||