|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omegahat.Models.Formulae.Expressions.ModelAnalyzer
Provides a form of reflectance for certain characteristics of a given model, revealing the dependent, independent and free variables.
| Field Summary | |
protected FormulaName[] |
dependentVariables
Collection of the dependent variables in the model that is cached when it is first computed. |
protected MultiLineModelFormula |
formula
The symbolic version of the model to be analyzed. |
protected FormulaName[] |
freeVariables
Collection of the free variables in the model associated with this object that is cached when it is first computed. |
| Constructor Summary | |
ModelAnalyzer(ModelFormula formula)
Constructor that takes a model consisting of a single formula. |
|
ModelAnalyzer(MultiLineModelFormula formula)
Constructor using a model with one or more formulae elements. |
|
| Method Summary | |
FormulaName[] |
computeDependentVariables()
Compute all the variables that are identified on the left hand side of a formula in the model. |
protected int |
computeDependentVariables(ModelFormula formula,
java.util.HashSet els)
Compute the response variables (i.e. |
protected java.util.HashSet |
computeDependentVariableSet()
Internal method used to compute the list of dependent variables that has a different return type than the method computeDependentVariables. |
FormulaName[] |
computeFreeVariables()
Identifies the variables referenced in the model specification that are not defined as the LHS of any formula within the model. |
protected int |
computeFreeVariables(ModelFormula formula,
java.util.HashSet els)
Computes the free variables in the specified formula. |
protected FormulaName[] |
copyToArray(java.util.HashSet els)
Method to convert the elements in HashSet
to a more specific type - an array of FormulaName. |
FormulaName[] |
dependentVariables()
Return the collection of dependent variables in the model, computing and caching it as needed. |
FormulaName[] |
dependentVariables(boolean force)
|
FormulaName[] |
dependentVariables(FormulaName[] vars)
|
MultiLineModelFormula |
formula()
Retrieve the formula being analyzed by this object. |
protected MultiLineModelFormula |
formula(ModelFormula f)
Set the formula being analyzed by this object. |
protected MultiLineModelFormula |
formula(MultiLineModelFormula f)
Specify the formula to be analyzed, usually only set a instantiation of this object. |
FormulaName[] |
freeVariables()
Return the collection of free variables in the model, computing and caching it if it has not been computed previously. |
FormulaName[] |
freeVariables(boolean force)
Return the collection of the free variables identified in the associated model, optionally caching it for future calls. |
protected FormulaName[] |
freeVariables(FormulaName[] vars)
Cache the computed collection of free variables for quick recall in future computations. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected MultiLineModelFormula formula
protected FormulaName[] freeVariables
protected FormulaName[] dependentVariables
| Constructor Detail |
public ModelAnalyzer(ModelFormula formula)
public ModelAnalyzer(MultiLineModelFormula formula)
| Method Detail |
public FormulaName[] computeDependentVariables()
(x,y)).computeFreeVariables()protected java.util.HashSet computeDependentVariableSet()
computeDependentVariables.FormulaName.computeDependentVariables()
protected int computeDependentVariables(ModelFormula formula,
java.util.HashSet els)
equals()
of FormulaName.
protected int computeFreeVariables(ModelFormula formula,
java.util.HashSet els)
protected FormulaName[] copyToArray(java.util.HashSet els)
HashSet
to a more specific type - an array of FormulaName.public FormulaName[] computeFreeVariables()
FormulaName objects
identifying the free variables.computeDependentVariables(),
public MultiLineModelFormula formula()
protected MultiLineModelFormula formula(ModelFormula f)
protected MultiLineModelFormula formula(MultiLineModelFormula f)
public FormulaName[] freeVariables()
FormulaName
objects identifying the free variables.public FormulaName[] freeVariables(boolean force)
force - indicates whether to compute the values
if they have not been cached from previous calls.
By default, this is true by invoking
freeVariables()FormulaName elements
identifying each free variable.protected FormulaName[] freeVariables(FormulaName[] vars)
public FormulaName[] dependentVariables()
public FormulaName[] dependentVariables(boolean force)
public FormulaName[] dependentVariables(FormulaName[] vars)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||