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
public class VariablesInConstraintFinder extends AbstractStateVariablesInConstraintFinder
Searches for usedIDecisionVariables and their states inside aConstraintSyntaxTree.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<IAssignmentState>statesprivate java.util.Set<IDecisionVariable>variables
-
Constructor Summary
Constructors Constructor Description VariablesInConstraintFinder()Creates a constraint finder for reuse.VariablesInConstraintFinder(ConstraintSyntaxTree cst, Configuration config)Creates a constraint finder for single use directly oncst.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddVariable(IDecisionVariable var)Adds the relatedIDecisionVariableand their state to the result.voidclear()Clears this visitor for reuse.java.util.Set<IAssignmentState>getStates()java.util.Set<IDecisionVariable>getVariables()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, visitVariable
-
Methods inherited from class net.ssehub.easy.varModel.model.filter.AbstractVariableInConstraintFinder
visitBlockExpression, visitComment, visitCompoundInitializer, visitConstantValue, visitContainerInitializer, visitDeferInitExpression, visitIfThen, visitMultiAndExpression, visitOclFeatureCall, visitParenthesis, visitSelf, visitUnresolvedExpression, visitValue
-
-
-
-
Field Detail
-
variables
private java.util.Set<IDecisionVariable> variables
-
states
private java.util.Set<IAssignmentState> states
-
-
Constructor Detail
-
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
public VariablesInConstraintFinder(ConstraintSyntaxTree cst, Configuration config)
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 the cst belongs to (must not be null).
-
-
Method Detail
-
clear
public void clear()
Clears this visitor for reuse.- Overrides:
clearin classAbstractStateVariablesInConstraintFinder
-
getVariables
public java.util.Set<IDecisionVariable> getVariables()
Returns allIDecisionVariable's inside the givenConstraintSyntaxTree.- Returns:
- A set of nested
IDecisionVariable's (This set must not be null).
-
getStates
public java.util.Set<IAssignmentState> getStates()
- Returns:
- A set of nested
IAssignmentState's (This set must not be null).
-
addVariable
protected void addVariable(IDecisionVariable var)
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
-
-