Class IvmlDeclaration
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlElement
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlDeclaration
-
- All Implemented Interfaces:
IResolvable,IStringValueProvider,IVilType
public class IvmlDeclaration extends IvmlElement
Represents an IVML declaration. This class is internal and shall not be registered in the type factory. It is required as theConfigurationmay return only frozen elements (according to the actualIVariableFilter) with value but not declarations if needed. It maps to the use of an IVML identifier.- 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 IvmlDeclaration[]attributesprivate IvmlDeclaration[]nestedprivate AbstractVariablevariable
-
Constructor Summary
Constructors Constructor Description IvmlDeclaration(AbstractVariable variable)Creates a new declaration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object object)(package private) IvmlElementgetAttribute(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.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 simple name of the element.(package private) IvmlElementgetNested(int index)Returns the specified nested element.(package private) intgetNestedCount()Returns the number of nested elements.java.lang.StringgetQualifiedName()Returns the qualified name of the element.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
-
variable
private AbstractVariable variable
-
nested
private IvmlDeclaration[] nested
-
attributes
private IvmlDeclaration[] attributes
-
-
Constructor Detail
-
IvmlDeclaration
public IvmlDeclaration(AbstractVariable variable)
Creates a new declaration instance.- Parameters:
variable- the variable to create the declaration for
-
-
Method Detail
-
initializeNested
protected void initializeNested()
Description copied from class:IvmlElementLazily initializes the nested parts.- Specified by:
initializeNestedin classIvmlElement
-
initializeAttributes
protected void initializeAttributes()
Description copied from class:IvmlElementLazily initializes the attributes.- Specified by:
initializeAttributesin classIvmlElement
-
getName
public java.lang.String getName()
Description copied from class:IvmlElementReturns the simple name of the element.- Specified by:
getNamein interfaceIResolvable- Specified by:
getNamein classIvmlElement- Returns:
- the simple name
-
getQualifiedName
public java.lang.String getQualifiedName()
Description copied from class:IvmlElementReturns the qualified name of the element.- Specified by:
getQualifiedNamein classIvmlElement- Returns:
- the qualified name
-
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
-
getNested
IvmlElement getNested(int index)
Returns the specified nested element.- Parameters:
index- the index of the nested element- Returns:
- the nested element
- Throws:
java.lang.IndexOutOfBoundsException- ifindex < 0 || index >=getNestedCount()
-
getNestedCount
int getNestedCount()
Returns the number of nested elements.- Returns:
- the number of nested elements
-
getAttribute
IvmlElement 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
-
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)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
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)
-
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)
-
-