Class VariableContainer
- java.lang.Object
-
- net.ssehub.easy.varModel.model.filter.mandatoryVars.VariableContainer
-
public class VariableContainer extends java.lang.ObjectStores theVariableImportanceto each variable of a configuration.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,Importance>importances
-
Constructor Summary
Constructors Constructor Description VariableContainer(Configuration config, MandatoryClassifierSettings settings)Single constructor for this class, initializes all variables in stateImportance.UNCLAER.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanhasMandatoryTypeOrParent(AbstractVariable declaration)Checks whether the given declaration is mandatory because of its type, or while the parent specifies that all nested elements shall be mandatory.booleanisMandatory(IDecisionVariable variable)Checks whether the givenIDecisionVariableis mandatory.booleanisMandatory(AbstractVariable declaration)Checks whether the givenAbstractVariableis mandatory.(package private) voidsetImportance(java.lang.String qName, Importance importance)Changes the importance of theIDecisionVariable.(package private) voidsetImportance(IDecisionVariable variable, Importance importance)Changes the importance of theIDecisionVariable.java.lang.StringtoString()
-
-
-
Field Detail
-
importances
private java.util.Map<java.lang.String,Importance> importances
-
-
Constructor Detail
-
VariableContainer
VariableContainer(Configuration config, MandatoryClassifierSettings settings)
Single constructor for this class, initializes all variables in stateImportance.UNCLAER.- Parameters:
config- TheConfiguration, for which the states are calculated.settings- Specification whether default values should be threaten as not mandatory.
-
-
Method Detail
-
setImportance
void setImportance(IDecisionVariable variable, Importance importance)
Changes the importance of theIDecisionVariable.- Parameters:
variable- TheIDecisionVariableto add.importance- The current importance state for theIDecisionVariable.
-
setImportance
void setImportance(java.lang.String qName, Importance importance)Changes the importance of theIDecisionVariable.- Parameters:
qName- The qualified name of a decision variable or a datatypeimportance- The current importance state for theIDecisionVariable.
-
isMandatory
public boolean isMandatory(IDecisionVariable variable)
Checks whether the givenIDecisionVariableis mandatory.- Parameters:
variable- TheIDecisionVariableto check.- Returns:
- true if the user should specify a value. This is only a heuristic value.
-
isMandatory
public boolean isMandatory(AbstractVariable declaration)
Checks whether the givenAbstractVariableis mandatory. This will also consider if a declaration is multiple times instantiates, e.g., a nested declaration of a compound.- Parameters:
declaration- TheAbstractVariableto check.- Returns:
- true if the user should specify a value. This is only a heuristic value.
-
hasMandatoryTypeOrParent
private boolean hasMandatoryTypeOrParent(AbstractVariable declaration)
Checks whether the given declaration is mandatory because of its type, or while the parent specifies that all nested elements shall be mandatory. Part ofisMandatory(IDecisionVariable)andisMandatory(AbstractVariable).- Parameters:
declaration- The declaration to check.- Returns:
- true if the user should specify a value. This is only a heuristic value.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-