Module aya.base

Record Class BindContext

java.lang.Object
java.lang.Record
org.aya.resolve.context.BindContext
All Implemented Interfaces:
Context

public record BindContext(@NotNull Context parent, @NotNull String name, @NotNull LocalVar ref) extends Record implements Context
Introduces a locally bound variable to the context.
  • Constructor Details

    • BindContext

      public BindContext(@NotNull @NotNull Context parent, @NotNull @NotNull String name, @NotNull @NotNull LocalVar ref)
      Creates an instance of a BindContext record class.
      Parameters:
      parent - the value for the parent record component
      name - the value for the name record component
      ref - the value for the ref record component
  • Method Details

    • parent

      @NotNull public @NotNull Context parent()
      Returns the value of the parent record component.
      Specified by:
      parent in interface Context
      Returns:
      the value of the parent record component
    • reporter

      @NotNull public @NotNull org.aya.util.reporter.Reporter reporter()
      Specified by:
      reporter in interface Context
    • underlyingFile

      @NotNull public @NotNull Path underlyingFile()
      Specified by:
      underlyingFile in interface Context
    • collect

      public kala.collection.mutable.MutableList<LocalVar> collect(@NotNull @NotNull kala.collection.mutable.MutableList<LocalVar> container)
      Specified by:
      collect in interface Context
    • getUnqualifiedLocalMaybe

      @Nullable public @Nullable AnyVar getUnqualifiedLocalMaybe(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Specified by:
      getUnqualifiedLocalMaybe in interface Context
    • getQualifiedLocalMaybe

      @Nullable public @Nullable AnyVar getQualifiedLocalMaybe(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<@NotNull String> modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Specified by:
      getQualifiedLocalMaybe in interface Context
    • getModuleLocalMaybe

      @Nullable public @Nullable kala.collection.mutable.MutableMap<String,AnyVar> getModuleLocalMaybe(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<String> modName)
      Specified by:
      getModuleLocalMaybe in interface Context
    • 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
    • hashCode

      public final 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
    • equals

      public final boolean equals(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.
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • ref

      @NotNull public @NotNull LocalVar ref()
      Returns the value of the ref record component.
      Returns:
      the value of the ref record component