Class TypeMapper
- java.lang.Object
-
- net.ssehub.easy.varModel.model.datatypes.TypeMapper
-
public class TypeMapper extends java.lang.ObjectMaps singleton type instances to unique names and back again. Basically, all instances of delegating types shall be mapped.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<?>DELEGATING_CLASSExports the meta-class of the package-local classDelegatingType.private static java.util.Map<java.lang.String,IDatatype>STRING_TYPEStores the name-to-type-mappings.private static java.util.Map<IDatatype,java.lang.String>TYPE_STRINGStores the type-to-name-mappings.
-
Constructor Summary
Constructors Constructor Description TypeMapper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetName(IDatatype type)Returns the mapping name for atype.static IDatatypegetType(java.lang.String name)Returns the mapped type for aname.private static voidput(java.lang.String name, IDatatype type)Adds a name-type-mapping.
-
-
-
Field Detail
-
DELEGATING_CLASS
public static final java.lang.Class<?> DELEGATING_CLASS
Exports the meta-class of the package-local classDelegatingType.
-
TYPE_STRING
private static final java.util.Map<IDatatype,java.lang.String> TYPE_STRING
Stores the type-to-name-mappings.
-
STRING_TYPE
private static final java.util.Map<java.lang.String,IDatatype> STRING_TYPE
Stores the name-to-type-mappings.
-
-
Method Detail
-
put
private static final void put(java.lang.String name, IDatatype type)Adds a name-type-mapping.- Parameters:
name- the (unique) textual name oftypetype- the mapped type
-
getName
public static final java.lang.String getName(IDatatype type)
Returns the mapping name for atype.- Parameters:
type- the type to return the mapping name for- Returns:
- the mapping name (null in case that there is no mapping)
-
getType
public static final IDatatype getType(java.lang.String name)
Returns the mapped type for aname.- Parameters:
name- the name to return the mapped type for- Returns:
- the mapped type (null in case that there is no mapping)
-
-