Class AbstractFrozenChecker<M extends ContainableModelElement>
java.lang.Object
net.ssehub.easy.varModel.model.rewrite.modifier.AbstractFrozenChecker<M>
- Type Parameters:
M- Type ofContainableModelElements, which shall be handled by this class.
- All Implemented Interfaces:
IModelElementFilter<M>
- Direct Known Subclasses:
FrozenCompoundConstraintsOmitter,FrozenConstraintsFilter,FrozenConstraintVarFilter,FrozenTypeDefResolver
public abstract class AbstractFrozenChecker<M extends ContainableModelElement>
extends Object
implements IModelElementFilter<M>
Super class for Filters which should remove elements based on already frozen variables.
- Author:
- El-Sharkawy
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFrozenChecker(Configuration config) Single constructor of this class. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanallInstancesAreFrozen(AbstractVariable declaration, RewriteContext context) Checks whether all instances of the given declaration are already frozen.protected booleanconstraintIsFrozen(ConstraintSyntaxTree constraint, RewriteContext context) Checks whether the given constraint contains only constant values or frozen variables.final ConfigurationGetter for the configuration (passed to the constructor).protected IDecisionVariablegetVariable(AbstractVariable declaration) Returns the specifiedIDecisionVariable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ssehub.easy.varModel.model.rewrite.modifier.IModelElementFilter
getModifyingModelClass, handleModelElement
-
Field Details
-
config
-
-
Constructor Details
-
AbstractFrozenChecker
Single constructor of this class.- Parameters:
config- A already initializedConfiguration, needed for checking whether an arbitrary variable is already frozen.
-
-
Method Details
-
getVariable
Returns the specifiedIDecisionVariable.- Parameters:
declaration- The declaration for which the configuration entity should be returned.- Returns:
- The
IDecisionVariablefor the given declaration
-
getConfiguration
Getter for the configuration (passed to the constructor).- Returns:
- The currently used configuration.
-
constraintIsFrozen
Checks whether the given constraint contains only constant values or frozen variables.- Parameters:
constraint- The constraint to check.context- Knowledge of the current translation, comes from theProjectRewriteVisitor- Returns:
trueif the constraint contains only frozen/constant elements or is null,falseif it contain at least one open variable.
-
allInstancesAreFrozen
Checks whether all instances of the given declaration are already frozen.- Parameters:
declaration- The declaration to check (if it is nested, it can have multiple instances).context- Knowledge of the current translation, comes from theProjectRewriteVisitor- Returns:
trueif all instances are frozen or if it has no instances,falseotherwise.
-