Module aya.base

Record Class EmptyContext

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

public record EmptyContext(@NotNull org.aya.util.reporter.Reporter reporter, @NotNull Path underlyingFile) extends Record implements Context
API Note:
in each file's dependency tree there should be one and only one EmptyContext which is also the tree root.
Implementation Note:
EmptyContext is the context storing the underlying file, and its Reporter in the resolving stage.
  • Constructor Details

    • EmptyContext

      public EmptyContext(@NotNull @NotNull org.aya.util.reporter.Reporter reporter, @NotNull @NotNull Path underlyingFile)
      Creates an instance of a EmptyContext record class.
      Parameters:
      reporter - the value for the reporter record component
      underlyingFile - the value for the underlyingFile record component
  • Method Details

    • parent

      @Nullable public @Nullable Context parent()
      Specified by:
      parent 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.
    • reporter

      @NotNull public @NotNull org.aya.util.reporter.Reporter reporter()
      Returns the value of the reporter record component.
      Specified by:
      reporter in interface Context
      Returns:
      the value of the reporter record component
    • underlyingFile

      @NotNull public @NotNull Path underlyingFile()
      Returns the value of the underlyingFile record component.
      Specified by:
      underlyingFile in interface Context
      Returns:
      the value of the underlyingFile record component