Class IvmlUtils
- java.lang.Object
-
- de.iip_ecosphere.platform.configuration.ivml.IvmlUtils
-
public class IvmlUtils extends java.lang.ObjectUtilities to access IVML/configuration values.- Author:
- Holger Eichelberger, SSE
-
-
Constructor Summary
Constructors Constructor Description IvmlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleangetBooleanValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var, boolean deflt)Returns a Boolean value from the givenvar.static net.ssehub.easy.varModel.model.values.ValuegetConstValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)Returns the constant value ofcstifcstis a constant expression.static net.ssehub.easy.varModel.model.values.EnumValuegetEnumValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var)Returns an enum value from the givenvar.static intgetIntValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var, int deflt)Returns an integer value from the givenvar.static intgetIntValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst, int dflt)Returns the constant int value ofcstifcstis a constant int expression.static net.ssehub.easy.varModel.confModel.IDecisionVariablegetNestedSafe(net.ssehub.easy.varModel.confModel.IDecisionVariable var, java.lang.String nested)Returns a nested variable, returning null ifvaris null.static java.lang.StringgetStringValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var, java.lang.String deflt)Returns a string value from the givenvar.static java.lang.StringgetVarNameSafe(net.ssehub.easy.varModel.model.AbstractVariable var, java.lang.String dflt)Returns the name ofvartaking null into account.static booleanisOfCompoundType(net.ssehub.easy.varModel.confModel.IDecisionVariable var, java.lang.String typeName)Returns whether the givenvaris of compound type with nametypeName.static java.lang.StringtoName(net.ssehub.easy.varModel.model.values.EnumValue value, java.lang.String deflt)Turns an enum value to its name.
-
-
-
Method Detail
-
isOfCompoundType
public static boolean isOfCompoundType(net.ssehub.easy.varModel.confModel.IDecisionVariable var, java.lang.String typeName)Returns whether the givenvaris of compound type with nametypeName.- Parameters:
var- the variabletypeName- the type name of the compound- Returns:
trueifvaris of a compound type withtypeName,falseelse
-
getNestedSafe
public static net.ssehub.easy.varModel.confModel.IDecisionVariable getNestedSafe(net.ssehub.easy.varModel.confModel.IDecisionVariable var, java.lang.String nested)Returns a nested variable, returning null ifvaris null.- Parameters:
var- the variablenested- the name of the nested variable- Returns:
- the nested variable or null
-
getStringValue
public static java.lang.String getStringValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var, java.lang.String deflt)Returns a string value from the givenvar.- Parameters:
var- the variable (may be null)deflt- the default value to return if no value can be obtained- Returns:
- the value or
deflt
-
getEnumValue
public static net.ssehub.easy.varModel.model.values.EnumValue getEnumValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var)
Returns an enum value from the givenvar.- Parameters:
var- the variable (may be null)- Returns:
- the value or null
-
toName
public static java.lang.String toName(net.ssehub.easy.varModel.model.values.EnumValue value, java.lang.String deflt)Turns an enum value to its name.- Parameters:
value- the value, may be nulldeflt- the default value to return if no value can be obtained- Returns:
- the name of the enum literal or
deflt
-
getIntValue
public static int getIntValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var, int deflt)Returns an integer value from the givenvar.- Parameters:
var- the variable (may be null)deflt- the default value to return if no value can be obtained- Returns:
- the value or
deflt
-
getBooleanValue
public static boolean getBooleanValue(net.ssehub.easy.varModel.confModel.IDecisionVariable var, boolean deflt)Returns a Boolean value from the givenvar.- Parameters:
var- the variable (may be null)deflt- the default value to return if no value can be obtained- Returns:
- the value or
deflt
-
getVarNameSafe
public static java.lang.String getVarNameSafe(net.ssehub.easy.varModel.model.AbstractVariable var, java.lang.String dflt)Returns the name ofvartaking null into account.- Parameters:
var- the variabledflt- the default ifvaris null- Returns:
- the name or
dflt
-
getConstValue
public static net.ssehub.easy.varModel.model.values.Value getConstValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst)
Returns the constant value ofcstifcstis a constant expression.- Parameters:
cst- the constraint syntax tree- Returns:
- the constant value or null
-
getIntValue
public static int getIntValue(net.ssehub.easy.varModel.cst.ConstraintSyntaxTree cst, int dflt)Returns the constant int value ofcstifcstis a constant int expression.- Parameters:
cst- the constraint syntax treedflt- the default value ifcstis not a constant int expression- Returns:
- the constant value or
dflt
-
-