Module aya.base
Package org.aya.ref

Record Class LocalVar

java.lang.Object
java.lang.Record
org.aya.ref.LocalVar
Record Components:
generateKind - whether this LocalVar is generated by aya, not exists in the source code. For example:
  • `| S Nat` is a ctor, but it actually is `| S (_1 Nat)` where `_1` is generated.
  • `variable A : Type` is a generalized variable, but a local var is generated when some one reference to it. For example: `def foo : A => {??}` actually is `def foo {A : Type} : A => {??}` where `A` is a generated local var
All Implemented Interfaces:
AnyVar

public record LocalVar(@NotNull String name, @NotNull org.aya.util.error.SourcePos definition, @NotNull GenerateKind generateKind) extends Record implements AnyVar
API Note:
generateKind() is None after deserializing from an aya binary, because we don't need to use them after deserializing for now.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull LocalVar
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LocalVar(@NotNull String name)
     
    LocalVar(@NotNull String name, @NotNull org.aya.util.error.SourcePos definition)
     
    LocalVar(@NotNull String name, @NotNull org.aya.util.error.SourcePos definition, @NotNull GenerateKind generateKind)
    Creates an instance of a LocalVar record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.aya.util.error.SourcePos
    Returns the value of the definition record component.
    boolean
    equals(@Nullable Object o)
    Indicates whether some other object is "equal to" this one.
    static @NotNull LocalVar
    from(@NotNull org.aya.util.error.WithPos<String> name)
     
    @NotNull GenerateKind
    Returns the value of the generateKind record component.
    int
    Returns a hash code value for this object.
    boolean
     
    @NotNull String
    Returns the value of the name record component.
    @NotNull LocalVar
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

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

    • IGNORED

      @NotNull public static final @NotNull LocalVar IGNORED
  • Constructor Details

    • LocalVar

      public LocalVar(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos definition)
    • LocalVar

      public LocalVar(@NotNull @NotNull String name)
    • LocalVar

      public LocalVar(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos definition, @NotNull @NotNull GenerateKind generateKind)
      Creates an instance of a LocalVar record class.
      Parameters:
      name - the value for the name record component
      definition - the value for the definition record component
      generateKind - the value for the generateKind record component
  • Method Details

    • from

      @NotNull public static @NotNull LocalVar from(@NotNull @NotNull org.aya.util.error.WithPos<String> name)
    • rename

      @NotNull public @NotNull LocalVar rename()
    • isGenerated

      public boolean isGenerated()
    • equals

      public boolean equals(@Nullable @Nullable Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Specified by:
      name in interface AnyVar
      Returns:
      the value of the name record component
    • definition

      @NotNull public @NotNull org.aya.util.error.SourcePos definition()
      Returns the value of the definition record component.
      Returns:
      the value of the definition record component
    • generateKind

      @NotNull public @NotNull GenerateKind generateKind()
      Returns the value of the generateKind record component.
      Returns:
      the value of the generateKind record component