Class VariablesInConstraintFinder
java.lang.Object
net.ssehub.easy.varModel.model.filter.AbstractVariableInConstraintFinder
net.ssehub.easy.varModel.model.filter.AbstractStateVariablesInConstraintFinder
net.ssehub.easy.varModel.model.filter.VariablesInConstraintFinder
- All Implemented Interfaces:
IConstraintTreeVisitor
Searches for used
IDecisionVariables and their states inside a ConstraintSyntaxTree.- Author:
- El-Sharkawy
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a constraint finder for reuse.VariablesInConstraintFinder(ConstraintSyntaxTree cst, Configuration config) Creates a constraint finder for single use directly oncst. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds the relatedIDecisionVariableand their state to the result.voidclear()Clears this visitor for reuse.Returns allIDecisionVariable's inside the givenConstraintSyntaxTree.Methods inherited from class net.ssehub.easy.varModel.model.filter.AbstractStateVariablesInConstraintFinder
addVariable, getConfiguration, getEvaluator, setConfiguration, visitAnnotationVariable, visitCompoundAccess, visitContainerOperationCall, visitLet, visitVariableMethods inherited from class net.ssehub.easy.varModel.model.filter.AbstractVariableInConstraintFinder
visitBlockExpression, visitComment, visitCompoundInitializer, visitConstantValue, visitContainerInitializer, visitDeferInitExpression, visitIfThen, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitSelf, visitUnresolvedExpression, visitValue
-
Field Details
-
variables
-
states
-
-
Constructor Details
-
VariablesInConstraintFinder
public VariablesInConstraintFinder()Creates a constraint finder for reuse. CallAbstractStateVariablesInConstraintFinder.setConfiguration(Configuration)first, accept then the constraint to be analyzed and callclear()afterwards to make the visitor instance ready for reuse. (must not be null). -
VariablesInConstraintFinder
Creates a constraint finder for single use directly oncst.- Parameters:
cst- A constraint where all nestedIDecisionVariable's should be found.config- The related Configuration of the project to where thecstbelongs to (must not be null).
-
-
Method Details
-
clear
public void clear()Clears this visitor for reuse.- Overrides:
clearin classAbstractStateVariablesInConstraintFinder
-
getVariables
Returns allIDecisionVariable's inside the givenConstraintSyntaxTree.- Returns:
- A set of nested
IDecisionVariable's (This set must not be null).
-
getStates
- Returns:
- A set of nested
IAssignmentState's (This set must not be null).
-
addVariable
Description copied from class:AbstractStateVariablesInConstraintFinderAdds the relatedIDecisionVariableand their state to the result.- Specified by:
addVariablein classAbstractStateVariablesInConstraintFinder- Parameters:
var- the variable to be added, may be null, ignored then
-