Class DefaultValueHelper
- java.lang.Object
-
- net.ssehub.easy.varModel.confModel.DefaultValueHelper
-
public class DefaultValueHelper extends java.lang.ObjectAssigns the defined default value(s). This class is intended to support interactive configuration. Otherwise, please rely on the reasoning capabilities. Instances of this class are intended for reuse, so callinitialize(IDecisionVariable)before use (alternativelyDefaultValueHelper(IDecisionVariable)for creation) andclear()after use.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private EvaluationVisitorevaluatorprivate java.util.Stack<IDecisionVariable>variables
-
Constructor Summary
Constructors Constructor Description DefaultValueHelper()Creates a new default value helper.DefaultValueHelper(IDecisionVariable variable)Creates an initialized default value helper by callinginitialize(IDecisionVariable).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidassignCompoundValue(Compound compound)Assigns the default value to a compound.private voidassignConstraintValue()Assigns the default value to a constraint variable.private voidassignDefaultValue(IDecisionVariable var)Assigns default value(s) to the given variablevar.private voidassignSingleExpressionDefault()Assigns a basic default value based on a single expression.voidclear()Clears this instance for reuse.static voidfillDefaults(IDecisionVariable variable)Fills the value of the givenvariablewith defined default values.private static EASyLoggerFactory.EASyLoggergetLogger()Returns the actual logger.voidinitialize(IDecisionVariable variable)Initializes this instance.
-
-
-
Field Detail
-
evaluator
private EvaluationVisitor evaluator
-
variables
private java.util.Stack<IDecisionVariable> variables
-
-
Constructor Detail
-
DefaultValueHelper
public DefaultValueHelper()
Creates a new default value helper. Callinitialize(IDecisionVariable).
-
DefaultValueHelper
public DefaultValueHelper(IDecisionVariable variable)
Creates an initialized default value helper by callinginitialize(IDecisionVariable).- Parameters:
variable- the variable to fill with default values
-
-
Method Detail
-
fillDefaults
public static void fillDefaults(IDecisionVariable variable)
Fills the value of the givenvariablewith defined default values. Currently, evaluation errors are ignored.- Parameters:
variable- the variable to fill
-
initialize
public void initialize(IDecisionVariable variable)
Initializes this instance.- Parameters:
variable- the variable to fill with default values
-
clear
public void clear()
Clears this instance for reuse.
-
assignDefaultValue
private void assignDefaultValue(IDecisionVariable var)
Assigns default value(s) to the given variablevar.- Parameters:
var- the variable to assign the default value(s)
-
assignConstraintValue
private void assignConstraintValue()
Assigns the default value to a constraint variable.
-
assignCompoundValue
private void assignCompoundValue(Compound compound)
Assigns the default value to a compound.- Parameters:
compound- the compound type
-
assignSingleExpressionDefault
private void assignSingleExpressionDefault()
Assigns a basic default value based on a single expression.
-
getLogger
private static EASyLoggerFactory.EASyLogger getLogger()
Returns the actual logger.- Returns:
- the logger
-
-