Record Class EfunSignature

java.lang.Object
java.lang.Record
io.github.protasm.jvmud.compiler.efun.EfunSignature
Record Components:
symbol - function symbol containing the LPC-facing name and return type
parameterTypes - LPC parameter types for this overload

public record EfunSignature(Symbol symbol, List<LPCType> parameterTypes) extends Record
Describes the LPC-facing signature of an engine function.

The Symbol stores the function name and return type. The parameter list stores the LPC types accepted by one concrete overload. JVMud overloads efuns by arity, so two signatures may share a name when their parameter counts differ.

  • Constructor Details

    • EfunSignature

      public EfunSignature(Symbol symbol, List<LPCType> parameterTypes)
      Creates an immutable signature.

      A null parameter list is normalized to an empty list so zero-argument efuns can be declared tersely by simple callers.

  • Method Details

    • name

      public String name()
      Returns the LPC-facing function name.
      Returns:
      function name used in LPC calls and registry lookup
    • returnType

      public LPCType returnType()
      Returns the LPC return type.
      Returns:
      return type advertised to semantic analysis and generated bytecode
    • arity

      public int arity()
      Returns the exact number of LPC arguments accepted by this overload.
      Returns:
      parameter count
    • 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.
    • symbol

      public Symbol symbol()
      Returns the value of the symbol record component.
      Returns:
      the value of the symbol record component
    • parameterTypes

      public List<LPCType> parameterTypes()
      Returns the value of the parameterTypes record component.
      Returns:
      the value of the parameterTypes record component