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
public interface IDatatype extends IDatatypeVisitable
Abstract class, implements some methods for all existing data types. Note that a datatype may be generic, i.e. parameterized (seegetGenericType(int). Important: Please do not use reference equality or the equals method for testing equality of datatypes. UseisAssignableFrom(IDatatype)instead.- Author:
- heiko beck, Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IDatatypegetGenericType(int index)Returns the specified generic type.intgetGenericTypeCount()Returns the number of generic types.java.lang.StringgetName()Method to get the name of the Datatype.java.lang.StringgetNameSpace()Returns the namespace of this datatype.OperationgetOperation(int index)Returns the operation specified byindex.intgetOperationCount()Returns the number of operations.java.lang.StringgetQualifiedName()Returns the qualified name of this element.IDatatypegetType()Returns the object realizing the type.java.lang.Class<? extends IDatatype>getTypeClass()Returns the java class realizing the type.java.lang.StringgetUniqueName()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.booleanisPrimitive()Returns whether this type is a primitive type.booleanisPseudoType()Returns whether this type is a pseudo type.-
Methods inherited from interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitable
accept
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
Method to get the name of the Datatype.- Returns:
- name of the Datatype
-
getNameSpace
java.lang.String getNameSpace()
Returns the namespace of this datatype.- Returns:
- Namespace of this datatype.
-
getQualifiedName
java.lang.String getQualifiedName()
Returns the qualified name of this element.- Returns:
- the qualified name
-
getUniqueName
java.lang.String getUniqueName()
Returns the unique name of this element.- Returns:
- the unique name
-
getOperation
Operation getOperation(int index)
Returns the operation specified byindex.- Parameters:
index- a 0-based index specifying the operation to be returned- Returns:
- the operation
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index>=getOperationCount()
-
getOperationCount
int getOperationCount()
Returns the number of operations.- Returns:
- the number of operations
-
isAssignableFrom
boolean isAssignableFrom(IDatatype type)
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
java.lang.Class<? extends IDatatype> 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
IDatatype getGenericType(int index)
Returns the specified generic type.- Parameters:
index- the index of the type- Returns:
- the specified generic type
- Throws:
java.lang.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
-
-