public class VariablesInConstraintFinder
extends net.ssehub.easy.varModel.model.filter.AbstractStateVariablesInConstraintFinder
IDecisionVariables and their states inside a ConstraintSyntaxTree. For reuse,
call AbstractStateVariablesInConstraintFinder.setConfiguration(Configuration) first, then visit the respective constraint, call one of the getters
to obtain the result, e.g., isConstraintFrozen() and finally clear().| Modifier and Type | Field and Description |
|---|---|
private int |
frozenVariablesCount |
private int |
localVariablesCount |
private int |
variablesCount |
| Constructor and Description |
|---|
VariablesInConstraintFinder()
Creates a constraint finder for reuse.
|
VariablesInConstraintFinder(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst,
net.ssehub.easy.varModel.confModel.Configuration config)
Creates a constraint finder for single use directly on
cst. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable var) |
void |
clear()
Clears this visitor for reuse.
|
int |
getFrozenVariablesCount()
Returns the number of frozen variables used in the visited constraint.
|
int |
getLocalVariablesCount()
Returns the number of local variables used in the visited constraint.
|
int |
getVariablesCount()
Returns the number of variables used in the visited constraint.
|
boolean |
isConstraintFrozen()
Returns whether there are only
local variables and
frozen variables in the visited constraint. |
addVariable, getConfiguration, getEvaluator, setConfiguration, visitAnnotationVariable, visitCompoundAccess, visitContainerOperationCall, visitLet, visitVariablevisitBlockExpression, visitComment, visitCompoundInitializer, visitConstantValue, visitContainerInitializer, visitDeferInitExpression, visitIfThen, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitSelf, visitUnresolvedExpression, visitValueprivate int variablesCount
private int frozenVariablesCount
private int localVariablesCount
public VariablesInConstraintFinder()
AbstractStateVariablesInConstraintFinder.setConfiguration(Configuration) first, accept then the
constraint to be analyzed and call clear() afterwards to make the visitor instance ready for reuse.public VariablesInConstraintFinder(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst,
net.ssehub.easy.varModel.confModel.Configuration config)
cst.cst - A constraint where all nested IDecisionVariable's should be found.config - The related Configuration of the project to where the cst belongs to
(must not be null).public void clear()
clear in class net.ssehub.easy.varModel.model.filter.AbstractStateVariablesInConstraintFinderpublic int getFrozenVariablesCount()
public int getLocalVariablesCount()
public int getVariablesCount()
public boolean isConstraintFrozen()
local variables and
frozen variables in the visited constraint.true for a frozen constraint, false elseprotected void addVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
addVariable in class net.ssehub.easy.varModel.model.filter.AbstractStateVariablesInConstraintFinderCopyright © 2009 - 2018 SSE. All Rights Reserved.