Class ScopeAssignments
- java.lang.Object
-
- net.ssehub.easy.reasoning.sseReasoner.functions.ScopeAssignments
-
public class ScopeAssignments extends java.lang.ObjectClass contains variables that were assigned in a specific scope..- Author:
- Sizonenko
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<IDecisionVariable>currentScopeSetprivate java.util.Map<IModelElement,java.util.Set<IDecisionVariable>>scopeAssignments
-
Constructor Summary
Constructors Constructor Description ScopeAssignments()Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAssignedVariable(IDecisionVariable variable)Method for registering a variable that was assigned.voidclear()Clears all assignments.voidclearScopeAssignments(Project scope)Clears all scope assignments forscope.voidsetCurrentScope(Constraint constraint)Defines the current scope due to the parents of the givenconstraint.voidsetCurrentScope(IModelElement currentScope)Defines the current scope.booleanwasAssignedInThisScope(IDecisionVariable variable)Method for determining if variable was assigned in the specific scope.
-
-
-
Field Detail
-
scopeAssignments
private java.util.Map<IModelElement,java.util.Set<IDecisionVariable>> scopeAssignments
-
currentScopeSet
private transient java.util.Set<IDecisionVariable> currentScopeSet
-
-
Method Detail
-
addAssignedVariable
public void addAssignedVariable(IDecisionVariable variable)
Method for registering a variable that was assigned. CallsetCurrentScope(IModelElement)before.- Parameters:
variable- Assigned variable.
-
wasAssignedInThisScope
public boolean wasAssignedInThisScope(IDecisionVariable variable)
Method for determining if variable was assigned in the specific scope. CallsetCurrentScope(IModelElement)before.- Parameters:
variable- Variable under question.- Returns:
- True if variable already was assigned in this scope.
-
clear
public void clear()
Clears all assignments.
-
clearScopeAssignments
public void clearScopeAssignments(Project scope)
Clears all scope assignments forscope.- Parameters:
scope- the scope to clear
-
setCurrentScope
public void setCurrentScope(Constraint constraint)
Defines the current scope due to the parents of the givenconstraint.- Parameters:
constraint- defining the current scope
-
setCurrentScope
public void setCurrentScope(IModelElement currentScope)
Defines the current scope.- Parameters:
currentScope- the current scope
-
-