Class Attribute
- 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.Attribute
-
- All Implemented Interfaces:
IResolvable,IActualTypeProvider,IStringValueProvider,IVilType
public class Attribute extends AbstractIvmlVariable
Represents an attribute from a variability model imported into VIL.- 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 inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.configuration.AbstractIvmlVariable
filter, origVariable, variable
-
-
Constructor Summary
Constructors Constructor Description Attribute(Configuration parent, IDecisionVariable attribute, IVariableFilter filter)Creates a new attribute instance.
-
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(Attribute val)Conversion operation to Boolean.static EnumValueconvert2EnumValue(Attribute val)Conversion operation to an EnumValue.static intconvert2Integer(Attribute val)Conversion operation to Integer.static doubleconvert2Real(Attribute val)Conversion operation to Real.static Sequence<DecisionVariable>convert2Sequence(Attribute val)Conversion operation to an EnumValue.static java.lang.Stringconvert2String(Attribute val)Conversion operation to String.(package private) AttributegetAttribute(int index)Returns the specified attribute.(package private) intgetAttributeCount()Returns the number of attributes.protected voidinitializeAttributes()Lazily initializes the attributes.Sequence<DecisionVariable>variables()Returns the decision variables contained in this variable.-
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, getName, getOriginalValue, getParent, getQualifiedName, getQualifiedType, getQualifiedVarName, getRealValue, getStringValue, getType, getTypeName, getValue, getVariable, getVarName, hashCode, initializeNested, isConfigured, isFrozen, isVariable, selectAll, setValue, toObject, toString, 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
-
Attribute
Attribute(Configuration parent, IDecisionVariable attribute, IVariableFilter filter)
Creates a new attribute instance.- Parameters:
parent- the parent configurationattribute- the IVML attributefilter- the variable filter to apply
-
-
Method Detail
-
initializeAttributes
protected void initializeAttributes()
Description copied from class:IvmlElementLazily initializes the attributes.- Specified by:
initializeAttributesin classIvmlElement
-
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
-
variables
public Sequence<DecisionVariable> variables()
Description copied from class:AbstractIvmlVariableReturns the decision variables contained in this variable. This shall be a sequence to implicitly handle IVML sequences. Primitive values may be obtained using the getter methods. Complex values such as compounds or containers may be accessed viaAbstractIvmlVariable.variables().- Overrides:
variablesin classAbstractIvmlVariable- Returns:
- the decision variables (unmodifiable)
-
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
-
convert2Real
public static double convert2Real(Attribute 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 attribute)
-
convert2Integer
public static int convert2Integer(Attribute 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 attribute)
-
convert2Boolean
public static boolean convert2Boolean(Attribute 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 attribute)
-
convert2String
public static java.lang.String convert2String(Attribute 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 attribute)
-
convert2EnumValue
public static EnumValue convert2EnumValue(Attribute 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 attribute)
-
convert2Sequence
public static Sequence<DecisionVariable> convert2Sequence(Attribute 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)
-
-