Class TypeMapper

java.lang.Object
net.ssehub.easy.varModel.model.datatypes.TypeMapper

public class TypeMapper extends Object
Maps singleton type instances to unique names and back again. Basically, all instances of delegating types shall be mapped.
Author:
Holger Eichelberger
  • Field Details

    • DELEGATING_CLASS

      public static final Class<?> DELEGATING_CLASS
      Exports the meta-class of the package-local class DelegatingType.
    • TYPE_STRING

      private static final Map<IDatatype,String> TYPE_STRING
      Stores the type-to-name-mappings.
    • STRING_TYPE

      private static final Map<String,IDatatype> STRING_TYPE
      Stores the name-to-type-mappings.
  • Constructor Details

    • TypeMapper

      public TypeMapper()
  • Method Details

    • put

      private static final void put(String name, IDatatype type)
      Adds a name-type-mapping.
      Parameters:
      name - the (unique) textual name of type
      type - the mapped type
    • getName

      public static final String getName(IDatatype type)
      Returns the mapping name for a type.
      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(String name)
      Returns the mapped type for a name.
      Parameters:
      name - the name to return the mapped type for
      Returns:
      the mapped type (null in case that there is no mapping)