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 typeparameterTypes- fixed LPC parameter types for this overloadvarargsParameterType- LPC type accepted by additional tail arguments, ornull
public record EfunSignature(Symbol symbol, List<LPCType> parameterTypes, LPCType varargsParameterType)
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
fixed LPC parameter types accepted by one overload. Signatures may also declare an optional
varargs tail type for engine functions that accept any number of additional arguments.
-
Constructor Summary
ConstructorsConstructorDescriptionEfunSignature(Symbol symbol, List<LPCType> parameterTypes) EfunSignature(Symbol symbol, List<LPCType> parameterTypes, LPCType varargsParameterType) Creates an immutable signature. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsArity(int arity) Returns whether this signature accepts a call witharityarguments.intarity()Returns the fixed number of LPC arguments before any optional varargs tail.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisExactArity(int arity) Returns whether this signature is an exact fixed-arity match forarity.booleanReturns whether this signature accepts optional tail arguments.name()Returns the LPC-facing function name.Returns the value of theparameterTypesrecord component.Returns the LPC return type.symbol()Returns the value of thesymbolrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevarargsParameterTyperecord component.
-
Constructor Details
-
EfunSignature
-
EfunSignature
Creates an immutable signature.A
nullparameter list is normalized to an empty list so zero-argument efuns can be declared tersely by simple callers. Anullvarargs parameter type means the signature accepts only its fixed parameters.
-
-
Method Details
-
name
Returns the LPC-facing function name.- Returns:
- function name used in LPC calls and registry lookup
-
returnType
Returns the LPC return type.- Returns:
- return type advertised to semantic analysis and generated bytecode
-
arity
public int arity()Returns the fixed number of LPC arguments before any optional varargs tail.- Returns:
- parameter count
-
isVarargs
public boolean isVarargs()Returns whether this signature accepts optional tail arguments. -
acceptsArity
public boolean acceptsArity(int arity) Returns whether this signature accepts a call witharityarguments. -
isExactArity
public boolean isExactArity(int arity) Returns whether this signature is an exact fixed-arity match forarity. -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
symbol
-
parameterTypes
Returns the value of theparameterTypesrecord component.- Returns:
- the value of the
parameterTypesrecord component
-
varargsParameterType
Returns the value of thevarargsParameterTyperecord component.- Returns:
- the value of the
varargsParameterTyperecord component
-