Class Type.Key

java.lang.Object
net.hydromatic.morel.type.Type.Key
Direct Known Subclasses:
Keys.ApplyKey, Keys.DataTypeKey, Keys.ForallKey, Keys.NameKey, Keys.OpKey, Keys.OrdinalKey, Keys.ProgressiveRecordKey, Keys.RecordKey
Enclosing interface:
Type

public abstract static class Type.Key extends Object
Structural identifier of a type.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Op
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Key(Op op)
    Creates a key.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) Type.Key
    Copies this key, applying a transform to constituent keys.
    (package private) abstract StringBuilder
    describe(StringBuilder buf, int left, int right)
    Writes a description of this key to a string builder.
    (package private) Type.Key
    substitute(List<? extends Type> types)
    If this is a type variable ordinal, returns the ordinalth type in the list, otherwise this.
    Returns a description of this key.
    abstract Type
    toType(TypeSystem typeSystem)
    Converts this key to a type, and ensures that it is registered in the type system.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • op

      public final Op op
  • Constructor Details

    • Key

      protected Key(Op op)
      Creates a key.
  • Method Details

    • toString

      public String toString()
      Returns a description of this key.

      The default implementation calls describe(StringBuilder, int, int), but subclasses may override to provide a more efficient implementation.

      Overrides:
      toString in class Object
    • describe

      abstract StringBuilder describe(StringBuilder buf, int left, int right)
      Writes a description of this key to a string builder.
    • toType

      public abstract Type toType(TypeSystem typeSystem)
      Converts this key to a type, and ensures that it is registered in the type system.
    • substitute

      Type.Key substitute(List<? extends Type> types)
      If this is a type variable ordinal, returns the ordinalth type in the list, otherwise this.
    • copy

      Type.Key copy(UnaryOperator<Type.Key> transform)
      Copies this key, applying a transform to constituent keys.