Interface IDatatype
- All Superinterfaces:
IDatatypeVisitable
- All Known Implementing Classes:
AnyType,BasisDatatype,BooleanType,Compound,ConstraintType,Container,CustomDatatype,DelegatingType,DerivedDatatype,Enum,FreezeVariableType,IntegerType,MetaType,OrderedEnum,ProjectType,RealType,Reference,Sequence,Set,StringType,StructuredDatatype,VersionType,VoidType
Abstract class, implements some methods for all existing data types.
Note that a datatype may be generic, i.e. parameterized (see
getGenericType(int).
Important: Please do not use reference equality or the equals method for testing
equality of datatypes. Use isAssignableFrom(IDatatype) instead.- Author:
- heiko beck, Holger Eichelberger
-
Method Summary
Modifier and TypeMethodDescriptiongetGenericType(int index) Returns the specified generic type.intReturns the number of generic types.getName()Method to get the name of the Datatype.Returns the namespace of this datatype.getOperation(int index) Returns the operation specified byindex.intReturns the number of operations.Returns the qualified name of this element.getType()Returns the object realizing the type.Returns the java class realizing the type.Returns the unique name of this element.booleanisAssignableFrom(IDatatype type) Determines if the data type represented by this object is either the same as, or is a supertype oftype.booleanReturns whether this type is a primitive type.booleanReturns whether this type is a pseudo type.Methods inherited from interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitable
accept
-
Method Details
-
getName
String getName()Method to get the name of the Datatype.- Returns:
- name of the Datatype
-
getNameSpace
String getNameSpace()Returns the namespace of this datatype.- Returns:
- Namespace of this datatype.
-
getQualifiedName
String getQualifiedName()Returns the qualified name of this element.- Returns:
- the qualified name
-
getUniqueName
String getUniqueName()Returns the unique name of this element.- Returns:
- the unique name
-
getOperation
Returns the operation specified byindex.- Parameters:
index- a 0-based index specifying the operation to be returned- Returns:
- the operation
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getOperationCount()
-
getOperationCount
int getOperationCount()Returns the number of operations.- Returns:
- the number of operations
-
isAssignableFrom
Determines if the data type represented by this object is either the same as, or is a supertype oftype.- Parameters:
type- the type being checked- Returns:
trueif this type is either the same or a supertype oftype,falseelse
-
getTypeClass
Returns the java class realizing the type.- Returns:
- the java class realizing the type
-
getType
IDatatype getType()Returns the object realizing the type.- Returns:
- the object realizing the type
-
getGenericType
Returns the specified generic type.- Parameters:
index- the index of the type- Returns:
- the specified generic type
- Throws:
IndexOutOfBoundsException- ifindex<0 || index>=getGenericTypeCount()
-
getGenericTypeCount
int getGenericTypeCount()Returns the number of generic types.- Returns:
- the number of generic types
-
isPseudoType
boolean isPseudoType()Returns whether this type is a pseudo type. This operation shall be used to prevent the output of internal types to the user.- Returns:
trueif it is a pseudo type,falseelse
-
isPrimitive
boolean isPrimitive()Returns whether this type is a primitive type.- Returns:
trueif it is a primitive type,falseelse
-