Module aya.base

Record Class Expr.NamedArg

java.lang.Object
java.lang.Record
org.aya.concrete.Expr.NamedArg
All Implemented Interfaces:
AyaDocile, org.aya.util.binop.BinOpParser.Elem<Expr>, org.aya.util.error.SourceNode
Enclosing interface:
Expr

public static record Expr.NamedArg(boolean explicit, @Nullable String name, @NotNull Expr term) extends Record implements AyaDocile, org.aya.util.error.SourceNode, org.aya.util.binop.BinOpParser.Elem<Expr>
  • Constructor Summary

    Constructors
    Constructor
    Description
    NamedArg(boolean explicit, @Nullable String name, @NotNull Expr term)
    Creates an instance of a NamedArg record class.
    NamedArg(boolean explicit, @NotNull Expr expr)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Expr.NamedArg
    descent(@NotNull Function<@NotNull Expr,@NotNull Expr> f)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the explicit record component.
    final int
    Returns a hash code value for this object.
    @Nullable String
    Returns the value of the name record component.
    @NotNull org.aya.util.error.SourcePos
     
    @NotNull Expr
    Returns the value of the term record component.
    @NotNull org.aya.pretty.doc.Doc
    toDoc(@NotNull org.aya.util.distill.DistillerOptions options)
     
    final String
    Returns a string representation of this record class.
    @NotNull Expr.NamedArg
    update(@NotNull Expr expr)
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.aya.generic.AyaDocile

    debuggerOnlyToDoc
  • Constructor Details

    • NamedArg

      public NamedArg(boolean explicit, @NotNull @NotNull Expr expr)
    • NamedArg

      public NamedArg(boolean explicit, @Nullable @Nullable String name, @NotNull @NotNull Expr term)
      Creates an instance of a NamedArg record class.
      Parameters:
      explicit - the value for the explicit record component
      name - the value for the name record component
      term - the value for the term record component
  • Method Details

    • update

      @NotNull public @NotNull Expr.NamedArg update(@NotNull @NotNull Expr expr)
    • descent

      @NotNull public @NotNull Expr.NamedArg descent(@NotNull @NotNull Function<@NotNull Expr,@NotNull Expr> f)
    • toDoc

      @NotNull public @NotNull org.aya.pretty.doc.Doc toDoc(@NotNull @NotNull org.aya.util.distill.DistillerOptions options)
      Specified by:
      toDoc in interface AyaDocile
    • sourcePos

      @NotNull public @NotNull org.aya.util.error.SourcePos sourcePos()
      Specified by:
      sourcePos in interface org.aya.util.error.SourceNode
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • explicit

      public boolean explicit()
      Returns the value of the explicit record component.
      Specified by:
      explicit in interface org.aya.util.binop.BinOpParser.Elem<Expr>
      Returns:
      the value of the explicit record component
    • name

      @Nullable public @Nullable String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • term

      @NotNull public @NotNull Expr term()
      Returns the value of the term record component.
      Specified by:
      term in interface org.aya.util.binop.BinOpParser.Elem<Expr>
      Returns:
      the value of the term record component