Class Context
- java.lang.Object
-
- net.ssehub.easy.varModel.model.filter.mandatoryVars.Context
-
class Context extends java.lang.ObjectStores knowledge about the current constraint visitation (the context of earlier elements).- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Deque<java.lang.String>currentParentsprivate intdepthprivate booleanelementsFound
-
Constructor Summary
Constructors Constructor Description Context()Constructor for this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddParent(java.lang.String parent)Adds a parent, e.g.(package private) voidclear()Should be called after a constraint was visited completly, to clear the data.(package private) voidcompoundDown()Marks that a compound(access) was visited and that now a slot is visited of the compound.(package private) voidcompoundUp()A compound(slot) was visited, back to upper compound.(package private) intdepth()Returns the depth, a depth > 0 means that currently a slot of a compound is visited).(package private) voidelementFound()Marks that at least one variable was found during the current constraint visitation.(package private) booleanelementsWereFound()Returns whether variables were changed during the current constraint visitation.(package private) java.lang.StringgetParent()Returns the current visited parent of the current variable.(package private) booleanhasParent()Returns whether currently a qualified name for aIDecisionVariableas parent is stored for the current visitation.
-
-
-
Method Detail
-
clear
void clear()
Should be called after a constraint was visited completly, to clear the data.
-
compoundDown
void compoundDown()
Marks that a compound(access) was visited and that now a slot is visited of the compound.- See Also:
compoundUp()
-
compoundUp
void compoundUp()
A compound(slot) was visited, back to upper compound.- See Also:
compoundDown()
-
depth
int depth()
Returns the depth, a depth > 0 means that currently a slot of a compound is visited).- Returns:
- A value >= 0.
-
hasParent
boolean hasParent()
Returns whether currently a qualified name for aIDecisionVariableas parent is stored for the current visitation.- Returns:
- true a parent exists for the current visited variable.
- See Also:
getParent(),addParent(String)
-
getParent
java.lang.String getParent()
Returns the current visited parent of the current variable.- Returns:
- The parent.
- See Also:
hasParent(),addParent(String)
-
addParent
void addParent(java.lang.String parent)
Adds a parent, e.g. if a compound access is visited.- Parameters:
parent- The current visited variable, before the visitation of the slot starts.- See Also:
getParent(),hasParent()
-
elementFound
void elementFound()
Marks that at least one variable was found during the current constraint visitation.- See Also:
elementsWereFound()
-
elementsWereFound
boolean elementsWereFound()
Returns whether variables were changed during the current constraint visitation.- Returns:
- trueAt least one variable was found.
- See Also:
elementFound()
-
-