Enum PrimitiveType

java.lang.Object
java.lang.Enum<PrimitiveType>
net.hydromatic.morel.type.PrimitiveType
All Implemented Interfaces:
Serializable, Comparable<PrimitiveType>, java.lang.constant.Constable, RecordLikeType, Type

public enum PrimitiveType extends Enum<PrimitiveType> implements RecordLikeType
Primitive type.
  • Enum Constant Details

  • Field Details

    • moniker

      public final String moniker
      The name in the language, e.g. bool.
  • Constructor Details

    • PrimitiveType

      private PrimitiveType()
  • Method Details

    • values

      public static PrimitiveType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static PrimitiveType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<PrimitiveType>
    • key

      public Type.Key key()
      Description copied from interface: Type
      Description of the type, e.g. "int", "int -> int", "NONE | SOME of 'a".
      Specified by:
      key in interface Type
    • op

      public Op op()
      Description copied from interface: Type
      Type operator.
      Specified by:
      op in interface Type
    • accept

      public <R> R accept(TypeVisitor<R> typeVisitor)
      Specified by:
      accept in interface Type
    • copy

      public PrimitiveType copy(TypeSystem typeSystem, UnaryOperator<Type> transform)
      Description copied from interface: Type
      Copies this type, applying a given transform to component types, and returning the original type if the component types are unchanged.
      Specified by:
      copy in interface Type
    • argNameTypes

      public SortedMap<String,Type> argNameTypes()
      Specified by:
      argNameTypes in interface RecordLikeType
    • argType

      public Type argType(int i)
      Description copied from interface: RecordLikeType
      Returns the type of the ith field, or throws.
      Specified by:
      argType in interface RecordLikeType