Class VariableHelper
java.lang.Object
eu.qualimaster.easy.extension.internal.VariableHelper
Some utility functions for IVML variables.
- Author:
- Holger Eichelberger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final net.ssehub.easy.varModel.confModel.IDecisionVariablefindNamedVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Finds a named variable of giventypeinconfig.static final net.ssehub.easy.varModel.confModel.IDecisionVariablefindNamedVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Finds a named variable of giventypeinvariable.static final BooleangetBoolean(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) Returns the value of a boolean compound slot.static final DoubleReturns the value of a double compound slot.static final IntegergetInteger(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) Returns the value of an integer compound slot.static StringgetName(net.ssehub.easy.varModel.confModel.IDecisionVariable var) Returns the logical name ofvarfrom slotQmConstants.SLOT_NAME.static final StringReturns the value of a string compound slot.static boolean
-
Constructor Details
-
VariableHelper
public VariableHelper()
-
-
Method Details
-
getName
Returns the logical name ofvarfrom slotQmConstants.SLOT_NAME.- Parameters:
var- the variable (may be null)- Returns:
- the name of
var, null if there is none
-
hasName
public static boolean hasName(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) - Parameters:
var- the variable (may be null)name- the name to look for- Returns:
trueifvarhas the given name,false(in all cases)
-
getBoolean
public static final Boolean getBoolean(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) Returns the value of a boolean compound slot.- Parameters:
var- the variable to look into (may be null)name- the name of the slot- Returns:
- the boolean value of the slot, null if there is no variable, no slot or no boolean value in the slot
-
getString
public static final String getString(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) Returns the value of a string compound slot.- Parameters:
var- the variable to look into (may be null)name- the name of the slot- Returns:
- the string value of the slot, null if there is no variable, no slot or no string value in the slot
-
getInteger
public static final Integer getInteger(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) Returns the value of an integer compound slot.- Parameters:
var- the variable to look into (may be null)name- the name of the slot- Returns:
- the integer value of the slot, null if there is no variable, no slot or no integer value in the slot
-
getDouble
public static final Double getDouble(net.ssehub.easy.varModel.confModel.IDecisionVariable var, String name) Returns the value of a double compound slot.- Parameters:
var- the variable to look into (may be null)name- the name of the slot- Returns:
- the double value of the slot, null if there is no variable, no slot or no integer value in the slot
-
findNamedVariable
public static final net.ssehub.easy.varModel.confModel.IDecisionVariable findNamedVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Finds a named variable of giventypeinconfig.- Parameters:
config- the configurationtype- the type to search for (ignored if null)name- the (logical) name- Returns:
- the decision variable
-
findNamedVariable
public static final net.ssehub.easy.varModel.confModel.IDecisionVariable findNamedVariable(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.datatypes.IDatatype type, String name) Finds a named variable of giventypeinvariable.- Parameters:
variable- the variable to search fortype- the type to search for (ignored if null)name- the (logical) name- Returns:
- the decision variable
-