public class AttributesCheckVisitor
extends java.lang.Object
implements net.ssehub.easy.varModel.confModel.IConfigurationVisitor
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isValid |
private ReasoningResult |
result |
private java.util.Map<java.lang.String,java.util.List<net.ssehub.easy.varModel.model.values.Value>> |
values |
| Modifier | Constructor and Description |
|---|---|
private |
AttributesCheckVisitor(ReasoningResult result,
AttributeValues values)
Creates a new visitor storing the given instances for processing.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
check(net.ssehub.easy.varModel.confModel.Configuration configuration,
AttributeValues values,
ReasoningResult result)
Checks the given
configuration with respect to values
and adjusts result if required. |
static boolean |
check(net.ssehub.easy.varModel.confModel.Configuration configuration,
ReasonerConfiguration reasonerConfiguration,
ReasoningResult result)
Checks the given
configuration with respect to values
and adjusts result if required. |
private boolean |
checkDecisionVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
Checks a single variable.
|
private boolean |
checkDecisionVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable attribute,
net.ssehub.easy.varModel.confModel.IAssignmentState state)
Checks a single variable.
|
static Message |
createMessage(java.lang.String variableName,
java.lang.String attributeName,
net.ssehub.easy.varModel.model.values.Value value,
net.ssehub.easy.varModel.model.ModelElement conflictingModelElement)
Creates the error message in case that an attribute assignment is missing.
|
private static java.lang.String |
getQualifiedName(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
Returns the qualified name of the given decision
variable. |
boolean |
isValid()
Returns whether the given configuration is valid with respect to the given set of attributes
and the actual values of the attributes.
|
void |
visitConfiguration(net.ssehub.easy.varModel.confModel.Configuration configuration) |
void |
visitDecisionVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable) |
private ReasoningResult result
private java.util.Map<java.lang.String,java.util.List<net.ssehub.easy.varModel.model.values.Value>> values
private boolean isValid
private AttributesCheckVisitor(ReasoningResult result, AttributeValues values)
values - the attribute values used as basis for the check (may be null)result - the reasoning results (may be modified as a side effect)public static boolean check(net.ssehub.easy.varModel.confModel.Configuration configuration,
ReasonerConfiguration reasonerConfiguration,
ReasoningResult result)
configuration with respect to values
and adjusts result if required.configuration - the configuration to be checked (will not be modified)reasonerConfiguration - the configuration holding the attribute values (may be null)result - the reasoning results (may be modified as a side effect)true if the configuration is valid, false elsepublic static boolean check(net.ssehub.easy.varModel.confModel.Configuration configuration,
AttributeValues values,
ReasoningResult result)
configuration with respect to values
and adjusts result if required.configuration - the configuration to be checked (will not be modified)values - the attribute values used as basis for the check (may be null)result - the reasoning results (may be modified as a side effect)true if the configuration is valid, false elsepublic boolean isValid()
true if the configuration is valid, false elsepublic void visitConfiguration(net.ssehub.easy.varModel.confModel.Configuration configuration)
visitConfiguration in interface net.ssehub.easy.varModel.confModel.IConfigurationVisitorpublic void visitDecisionVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
visitDecisionVariable in interface net.ssehub.easy.varModel.confModel.IConfigurationVisitorprivate boolean checkDecisionVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
variable - the configuration value to be checkedtrue if the configuration is valid, false elseprivate static java.lang.String getQualifiedName(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
variable.variable - the qualified name of the given decision variableprivate boolean checkDecisionVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable attribute,
net.ssehub.easy.varModel.confModel.IAssignmentState state)
attribute - the variable representing the attributestate - the assignment state of the variable being attributed by attributetrue if the configuration is valid, false elsepublic static Message createMessage(java.lang.String variableName, java.lang.String attributeName, net.ssehub.easy.varModel.model.values.Value value, net.ssehub.easy.varModel.model.ModelElement conflictingModelElement)
variableName - the name of the variable causing the errorattributeName - the name of the required attributevalue - the value of the required attributeconflictingModelElement - the model element representing the conflict (may be null if irrelevant)Copyright © 2009 - 2018 SSE. All Rights Reserved.