Class ParameterizedType

java.lang.Object
net.hydromatic.morel.type.BaseType
net.hydromatic.morel.type.ParameterizedType
All Implemented Interfaces:
NamedType, Type
Direct Known Subclasses:
DataType

public abstract class ParameterizedType extends BaseType implements NamedType
Base class for types that accept type parameters.

These types have not just names but also monikers. For example, the datatype named option has instantiations whose monikers include int option, (string * bool) option, and 'b option.

  • Field Details

    • name

      public final String name
    • moniker

      public final String moniker
    • parameterTypes

      public final List<Type> parameterTypes
  • Constructor Details

    • ParameterizedType

      ParameterizedType(Op op, String name, String moniker, int parameterCount)
      Creates a ParameterizedType.
  • Method Details

    • name

      public String name()
      Description copied from interface: NamedType
      Name of the type.
      Specified by:
      name in interface NamedType
    • moniker

      public String moniker()
      Description copied from interface: Type
      Key of the type.

      Often the same as Type.key(), but an exception is datatype. For example, datatype "'a option" has moniker and name "option" and description "NONE | SOME of 'a".

      Use the description if you are looking for a type that is structurally equivalent. Use the moniker to identify it when printing.

      Specified by:
      moniker in interface Type
    • toString

      public String toString()
      Overrides:
      toString in class BaseType
    • computeMoniker

      static String computeMoniker(String name, List<? extends Type> typeVars)