Class EnumValue
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlElement
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.EnumValue
-
- All Implemented Interfaces:
IResolvable,IStringValueProvider,IVilType
public class EnumValue extends IvmlElement
Represents an IVML enum value.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IStringValueProvider
IStringValueProvider.StringComparator
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringconvert(EnumValue value)Converts an Enum value to a String by returning its (qualified) name.booleanequals(java.lang.Object object)(package private) AttributegetAttribute(int index)Returns the specified attribute.(package private) intgetAttributeCount()Returns the number of attributes.java.lang.BooleangetBooleanValue()Returns the boolean value of the decision variable.IDatatypegetDatatype()Returns the IVML data type.IvmlElementgetElement(java.lang.String name)Returns the element matching the given (qualified) name.EnumValuegetEnumValue()Returns the boolean value of the decision variable.java.lang.IntegergetIntegerValue()Returns the integer value of the decision variable.java.lang.StringgetName()Returns the name of the enum literal.intgetOrdinal()Returns the ordinal of the enum value.java.lang.StringgetQualifiedName()Returns the qualified name of the enum literal.java.lang.StringgetQualifiedType()Returns the qualified type name of the element.java.lang.DoublegetRealValue()Returns the real value of the decision variable.java.lang.StringgetStringValue()Returns the string value of the decision variable.TypeDescriptor<?>getType()Returns the VIL type of the element.java.lang.StringgetTypeName()Returns the simple type name of the element.java.lang.ObjectgetValue()Returns the (untyped) value of the decision variable.inthashCode()protected voidinitializeAttributes()Lazily initializes the attributes.protected voidinitializeNested()Lazily initializes the nested parts.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlElement
checkElement, equals, equals2, getAnnotation, getAnnotation, getAttribute, getAttribute, getInstanceName, getStringValue, getTypeDescriptor, isEnacting, isNull, isValid, search, unequals, unequals2
-
-
-
-
Field Detail
-
value
private EnumValue value
-
-
Constructor Detail
-
EnumValue
public EnumValue(EnumValue value)
Creates a new enum value.- Parameters:
value- the IVML enum literal
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the enum literal.- Specified by:
getNamein interfaceIResolvable- Specified by:
getNamein classIvmlElement- Returns:
- the name of the literal
-
getQualifiedName
public java.lang.String getQualifiedName()
Returns the qualified name of the enum literal.- Specified by:
getQualifiedNamein classIvmlElement- Returns:
- the qualified name of the literal
-
getDatatype
public IDatatype getDatatype()
Returns the IVML data type.- Returns:
- the IVML data type
-
getType
public TypeDescriptor<?> getType()
Description copied from class:IvmlElementReturns the VIL type of the element.- Specified by:
getTypein classIvmlElement- Returns:
- the VIL type (may be a fake descriptor if not resolved / no advice)
-
getTypeName
public java.lang.String getTypeName()
Description copied from class:IvmlElementReturns the simple type name of the element.- Specified by:
getTypeNamein classIvmlElement- Returns:
- the simple type name
-
getQualifiedType
public java.lang.String getQualifiedType()
Description copied from class:IvmlElementReturns the qualified type name of the element.- Specified by:
getQualifiedTypein classIvmlElement- Returns:
- the qualified type name
-
getAttribute
Attribute getAttribute(int index)
Description copied from class:IvmlElementReturns the specified attribute.- Specified by:
getAttributein classIvmlElement- Parameters:
index- the 0-based index of the attribute to return- Returns:
- the specified attribute
-
getAttributeCount
int getAttributeCount()
Description copied from class:IvmlElementReturns the number of attributes.- Specified by:
getAttributeCountin classIvmlElement- Returns:
- the number of attributes
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
getValue
public java.lang.Object getValue()
Description copied from class:IvmlElementReturns the (untyped) value of the decision variable.- Specified by:
getValuein classIvmlElement- Returns:
- the value (may be null)
-
getElement
public IvmlElement getElement(java.lang.String name)
Description copied from class:IvmlElementReturns the element matching the given (qualified) name.- Specified by:
getElementin classIvmlElement- Parameters:
name- the name to search for- Returns:
- the matching element or null if not found
-
getStringValue
public java.lang.String getStringValue()
Description copied from class:IvmlElementReturns the string value of the decision variable.- Specified by:
getStringValuein classIvmlElement- Returns:
- the value (may be null)
-
getIntegerValue
public java.lang.Integer getIntegerValue()
Description copied from class:IvmlElementReturns the integer value of the decision variable.- Specified by:
getIntegerValuein classIvmlElement- Returns:
- the value (may be null)
-
getOrdinal
public int getOrdinal()
Returns the ordinal of the enum value.- Returns:
- the ordinal
-
getRealValue
public java.lang.Double getRealValue()
Description copied from class:IvmlElementReturns the real value of the decision variable.- Specified by:
getRealValuein classIvmlElement- Returns:
- the value (may be null)
-
getBooleanValue
public java.lang.Boolean getBooleanValue()
Description copied from class:IvmlElementReturns the boolean value of the decision variable.- Specified by:
getBooleanValuein classIvmlElement- Returns:
- the value (may be null)
-
getEnumValue
public EnumValue getEnumValue()
Description copied from class:IvmlElementReturns the boolean value of the decision variable.- Specified by:
getEnumValuein classIvmlElement- Returns:
- the value (may be null)
-
initializeAttributes
protected void initializeAttributes()
Description copied from class:IvmlElementLazily initializes the attributes.- Specified by:
initializeAttributesin classIvmlElement
-
initializeNested
protected void initializeNested()
Description copied from class:IvmlElementLazily initializes the nested parts.- Specified by:
initializeNestedin classIvmlElement
-
convert
public static java.lang.String convert(EnumValue value)
Converts an Enum value to a String by returning its (qualified) name.- Parameters:
value- the value to be converted- Returns:
- the qualified name
-
-