Class DecisionVariable
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlElement
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.AbstractIvmlVariable
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.DecisionVariable
-
- All Implemented Interfaces:
IResolvable,IActualTypeProvider,IStringValueProvider,IVilType
public class DecisionVariable extends AbstractIvmlVariable
Realizes the bridge to the decision variables.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider
IStringValueProvider.StringComparator
-
-
Field Summary
Fields Modifier and Type Field Description private Attribute[]attributesstatic ValueDEFAULT-
Fields inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.configuration.AbstractIvmlVariable
filter, origVariable, variable
-
-
Constructor Summary
Constructors Constructor Description DecisionVariable(Configuration cfg, IDecisionVariable variable, IVariableFilter filter)Creates a decision variable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Attribute>annotations()Returns the annotations for this variable.Set<Attribute>attributes()Returns the annotations for this variable.static booleanconvert2Boolean(DecisionVariable val)Conversion operation to Boolean.static EnumValueconvert2EnumValue(DecisionVariable val)Conversion operation to an EnumValue.static intconvert2Integer(DecisionVariable val)Conversion operation to Integer.static doubleconvert2Real(DecisionVariable val)Conversion operation to Real.static Sequence<DecisionVariable>convert2Sequence(DecisionVariable val)Conversion operation to an EnumValue.static java.lang.Stringconvert2String(DecisionVariable val)Conversion operation to String.(package private) AttributegetAttribute(int index)Returns the specified attribute.(package private) intgetAttributeCount()Returns the number of attributes.java.lang.StringgetName()Returns the simple name of the decision variable.protected voidinitializeAttributes()Lazily initializes the attributes.booleanisKindOf(TypeDescriptor<?> type)Returns whethertypeis of the same or a super type as this object.booleanisTypeOf(TypeDescriptor<?> type)Returns whethertypeis of the same type as this object.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.configuration.AbstractIvmlVariable
addValue, addValue, clearValue, createValue, createValue, determineActualTypeName, equals, getActualType, getBooleanValue, getByName, getConfiguration, getDecisionVariable, getDeclaration, getElement, getEnumValue, getInstanceName, getIntegerValue, getIvmlType, getOriginalValue, getParent, getQualifiedName, getQualifiedType, getQualifiedVarName, getRealValue, getStringValue, getType, getTypeName, getValue, getVariable, getVarName, hashCode, initializeNested, isConfigured, isFrozen, isVariable, selectAll, setValue, toObject, toString, variables, variablesSet
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlElement
checkElement, equals, equals2, getAnnotation, getAnnotation, getAttribute, getAttribute, getStringValue, getTypeDescriptor, isEnacting, isNull, isValid, search, unequals, unequals2
-
-
-
-
Constructor Detail
-
DecisionVariable
DecisionVariable(Configuration cfg, IDecisionVariable variable, IVariableFilter filter)
Creates a decision variable.- Parameters:
cfg- the parent configuration variablevariable- the underlying IVML variablefilter- the variable filter
-
-
Method Detail
-
initializeAttributes
protected void initializeAttributes()
Description copied from class:IvmlElementLazily initializes the attributes.- Specified by:
initializeAttributesin classIvmlElement
-
attributes
public Set<Attribute> attributes()
Description copied from class:AbstractIvmlVariableReturns the annotations for this variable.- Specified by:
attributesin classAbstractIvmlVariable- Returns:
- the decision variables
-
annotations
public Set<Attribute> annotations()
Description copied from class:AbstractIvmlVariableReturns the annotations for this variable.- Specified by:
annotationsin classAbstractIvmlVariable- Returns:
- the decision variables
-
getAttribute
Attribute getAttribute(int index)
Returns the specified attribute.- Specified by:
getAttributein classIvmlElement- Parameters:
index- the 0-based index of the attribute to return- Returns:
- the specified attribute
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >=getAttributeCount()
-
getAttributeCount
int getAttributeCount()
Returns the number of attributes.- Specified by:
getAttributeCountin classIvmlElement- Returns:
- the number of attributes
-
convert2Real
public static double convert2Real(DecisionVariable val)
Conversion operation to Real.- Parameters:
val- the value (variable) to be converted- Returns:
- the converted value (may be null, depends on the type of the variable)
-
convert2Integer
public static int convert2Integer(DecisionVariable val)
Conversion operation to Integer.- Parameters:
val- the value (variable) to be converted- Returns:
- the converted value (may be null, depends on the type of the variable)
-
convert2Boolean
public static boolean convert2Boolean(DecisionVariable val)
Conversion operation to Boolean.- Parameters:
val- the value (variable) to be converted- Returns:
- the converted value (may be null, depends on the type of the variable)
-
convert2String
public static java.lang.String convert2String(DecisionVariable val)
Conversion operation to String.- Parameters:
val- the value (variable) to be converted- Returns:
- the converted value (may be null, depends on the type of the variable)
-
convert2EnumValue
public static EnumValue convert2EnumValue(DecisionVariable val)
Conversion operation to an EnumValue.- Parameters:
val- the value (variable) to be converted- Returns:
- the converted value (may be null, depends on the type of the variable)
-
convert2Sequence
public static Sequence<DecisionVariable> convert2Sequence(DecisionVariable val)
Conversion operation to an EnumValue.- Parameters:
val- the value (variable) to be converted- Returns:
- the converted value (may be null, depends on the type of the variable)
-
getName
public java.lang.String getName()
Returns the simple name of the decision variable.- Specified by:
getNamein interfaceIResolvable- Overrides:
getNamein classAbstractIvmlVariable- Returns:
- the simple name
-
isTypeOf
public boolean isTypeOf(TypeDescriptor<?> type)
Returns whethertypeis of the same type as this object.- Parameters:
type- the type to compare with- Returns:
trueiftypeis of the same type as this,falseelse
-
isKindOf
public boolean isKindOf(TypeDescriptor<?> type)
Returns whethertypeis of the same or a super type as this object.- Parameters:
type- the type to compare with- Returns:
trueiftypeis of the same or a super type as this,falseelse
-
-