Class CustomDatatype
- java.lang.Object
-
- net.ssehub.easy.varModel.model.ModelElement
-
- net.ssehub.easy.varModel.model.ContainableModelElement
-
- net.ssehub.easy.varModel.model.datatypes.CustomDatatype
-
- All Implemented Interfaces:
IDatatype,IDatatypeVisitable,IModelElement
- Direct Known Subclasses:
DerivedDatatype,Enum,Reference,StructuredDatatype
public abstract class CustomDatatype extends ContainableModelElement implements IDatatype
Abstract class, implements the setName method for the custom data types.- Author:
- heiko beck, Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private DelegatingTypesingleton
-
Constructor Summary
Constructors Modifier Constructor Description protectedCustomDatatype(java.lang.String name, DelegatingType singleton, IModelElement parent)Constructor for custom data type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IDatatypegetGenericType(int index)Returns the specified generic type.intgetGenericTypeCount()Returns the number of generic types.OperationgetOperation(int index)Returns the operation specified byindex.intgetOperationCount()Returns the number of operations.IDatatypegetType()Returns the object realizing the type.java.lang.Class<? extends IDatatype>getTypeClass()Returns the java class realizing the type.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.protected static booleanisType(IDatatype requestedType, IDatatype type, IDatatype... generics)Returns whethertypeofrequestedTypeand the givengenericsmatch.-
Methods inherited from class net.ssehub.easy.varModel.model.ContainableModelElement
accept, getNameSpace, getParent, getProject, getQualifiedName, getTopLevelParent, isTopLevel, setParent
-
Methods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.varModel.model.datatypes.IDatatype
getName, getNameSpace, getQualifiedName, getUniqueName
-
Methods inherited from interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitable
accept
-
Methods inherited from interface net.ssehub.easy.varModel.model.IModelElement
accept
-
-
-
-
Field Detail
-
singleton
private DelegatingType singleton
-
-
Constructor Detail
-
CustomDatatype
protected CustomDatatype(java.lang.String name, DelegatingType singleton, IModelElement parent)Constructor for custom data type.- Parameters:
name- Name of the custom data typesingleton- the instance which knows the operationsparent- the object, in which this specific one is embedded
-
-
Method Detail
-
getOperation
public final Operation getOperation(int index)
Description copied from interface:IDatatypeReturns the operation specified byindex.- Specified by:
getOperationin interfaceIDatatype- Parameters:
index- a 0-based index specifying the operation to be returned- Returns:
- the operation
-
getOperationCount
public final int getOperationCount()
Description copied from interface:IDatatypeReturns the number of operations.- Specified by:
getOperationCountin interfaceIDatatype- Returns:
- the number of operations
-
isAssignableFrom
public boolean isAssignableFrom(IDatatype type)
Determines if the data type represented by this object is either the same as, or is a supertype oftype.- Specified by:
isAssignableFromin interfaceIDatatype- Parameters:
type- the type being checked- Returns:
trueif this type is either the same or a supertype oftype,trueelse
-
getTypeClass
public java.lang.Class<? extends IDatatype> getTypeClass()
Returns the java class realizing the type.- Specified by:
getTypeClassin interfaceIDatatype- Returns:
- the java class realizing the type
-
getType
public IDatatype getType()
Returns the object realizing the type.
-
getGenericType
public IDatatype getGenericType(int index)
Description copied from interface:IDatatypeReturns the specified generic type.- Specified by:
getGenericTypein interfaceIDatatype- Parameters:
index- the index of the type- Returns:
- the specified generic type
-
getGenericTypeCount
public int getGenericTypeCount()
Description copied from interface:IDatatypeReturns the number of generic types.- Specified by:
getGenericTypeCountin interfaceIDatatype- Returns:
- the number of generic types
-
isPseudoType
public boolean isPseudoType()
Description copied from interface:IDatatypeReturns whether this type is a pseudo type. This operation shall be used to prevent the output of internal types to the user.- Specified by:
isPseudoTypein interfaceIDatatype- Returns:
trueif it is a pseudo type,falseelse
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:IDatatypeReturns whether this type is a primitive type.- Specified by:
isPrimitivein interfaceIDatatype- Returns:
trueif it is a primitive type,falseelse
-
isType
protected static final boolean isType(IDatatype requestedType, IDatatype type, IDatatype... generics)
Returns whethertypeofrequestedTypeand the givengenericsmatch.- Parameters:
requestedType- the requested basic typetype- the type to check forgenerics- the generics to be considered- Returns:
trueiftypeis arequestedTypewith the matching generics,falseelse
-
-