Module aya.base

Record Class ModuleExport

java.lang.Object
java.lang.Record
org.aya.resolve.context.ModuleExport

public record ModuleExport(@NotNull ModuleSymbol<org.aya.syntax.ref.AnyDefVar> symbols, @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport> modules) extends Record
A data class that contains all public definitions/re-exports of some module.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ModuleExport(@NotNull ModuleExport that)
     
    ModuleExport(@NotNull ModuleSymbol<org.aya.syntax.ref.AnyDefVar> symbols, @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport> modules)
    Creates an instance of a ModuleExport record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    export(@NotNull org.aya.syntax.concrete.stmt.ModuleName modName, @NotNull String name, @NotNull org.aya.syntax.ref.AnyDefVar ref)
     
    boolean
    export(org.aya.syntax.concrete.stmt.ModuleName.Qualified componentName, @NotNull ModuleExport module)
     
    final int
    Returns a hash code value for this object.
    @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport>
    Returns the value of the modules record component.
    @NotNull ModuleSymbol<org.aya.syntax.ref.AnyDefVar>
    Returns the value of the symbols record component.
    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
  • Constructor Details

    • ModuleExport

      public ModuleExport()
    • ModuleExport

      public ModuleExport(@NotNull @NotNull ModuleExport that)
    • ModuleExport

      public ModuleExport(@NotNull @NotNull ModuleSymbol<org.aya.syntax.ref.AnyDefVar> symbols, @NotNull @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport> modules)
      Creates an instance of a ModuleExport record class.
      Parameters:
      symbols - the value for the symbols record component
      modules - the value for the modules record component
  • Method Details

    • export

      public boolean export(@NotNull @NotNull org.aya.syntax.concrete.stmt.ModuleName modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.syntax.ref.AnyDefVar ref)
      Returns:
      false if there already exist a symbol with the same name.
    • export

      public boolean export(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified componentName, @NotNull @NotNull ModuleExport module)
    • 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.
    • symbols

      @NotNull public @NotNull ModuleSymbol<org.aya.syntax.ref.AnyDefVar> symbols()
      Returns the value of the symbols record component.
      Returns:
      the value of the symbols record component
    • modules

      @NotNull public @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport> modules()
      Returns the value of the modules record component.
      Returns:
      the value of the modules record component