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 java.lang.Object implements IModelElementFilter<M>
Super class for Filters which should remove elements based on already frozen variables.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfig
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractFrozenChecker(Configuration config)Single constructor of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.ConfigurationgetConfiguration()Getter 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, wait
-
Methods inherited from interface net.ssehub.easy.varModel.model.rewrite.modifier.IModelElementFilter
getModifyingModelClass, handleModelElement
-
-
-
-
Field Detail
-
config
private Configuration config
-
-
Constructor Detail
-
AbstractFrozenChecker
protected AbstractFrozenChecker(Configuration config)
Single constructor of this class.- Parameters:
config- A already initializedConfiguration, needed for checking whether an arbitrary variable is already frozen.
-
-
Method Detail
-
getVariable
protected IDecisionVariable getVariable(AbstractVariable declaration)
Returns the specifiedIDecisionVariable.- Parameters:
declaration- The declaration for which the configuration entity should be returned.- Returns:
- The
IDecisionVariablefor the given declaration
-
getConfiguration
public final Configuration getConfiguration()
Getter for the configuration (passed to the constructor).- Returns:
- The currently used configuration.
-
constraintIsFrozen
protected boolean constraintIsFrozen(ConstraintSyntaxTree constraint, RewriteContext context)
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:
- true if the constraint contains only frozen/constant elements or is null, false if it contain at least one open variable.
-
allInstancesAreFrozen
protected boolean allInstancesAreFrozen(AbstractVariable declaration, RewriteContext context)
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:
- true if all instances are frozen or if it has no instances,
otherwise.
-
-