Record Class OperatorDetails
java.lang.Object
java.lang.Record
org.ek9lang.compiler.common.OperatorDetails
public record OperatorDetails(String operator, String mappedName, boolean markedPure, boolean requiresArgument, boolean hasReturn)
extends Record
Holds some high level details about an operator.
These by their very nature cannot be too detailed, because when used the actual types involved
will vary.
But we do need to try and gather together the nature of operators.
See OperatorMap for use.
Also when generating the IR we need to know about purity and if a return is present. This aids in providing meta-data to the IR phase for optimisation and memory management.
-
Constructor Summary
ConstructorsConstructorDescriptionOperatorDetails(String operator, String mappedName, boolean markedPure, boolean requiresArgument, boolean hasReturn) Creates an instance of aOperatorDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasReturnrecord component.Returns the value of themappedNamerecord component.booleanReturns the value of themarkedPurerecord component.operator()Returns the value of theoperatorrecord component.booleanReturns the value of therequiresArgumentrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OperatorDetails
public OperatorDetails(String operator, String mappedName, boolean markedPure, boolean requiresArgument, boolean hasReturn) Creates an instance of aOperatorDetailsrecord class.- Parameters:
operator- the value for theoperatorrecord componentmappedName- the value for themappedNamerecord componentmarkedPure- the value for themarkedPurerecord componentrequiresArgument- the value for therequiresArgumentrecord componenthasReturn- the value for thehasReturnrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
operator
Returns the value of theoperatorrecord component.- Returns:
- the value of the
operatorrecord component
-
mappedName
Returns the value of themappedNamerecord component.- Returns:
- the value of the
mappedNamerecord component
-
markedPure
public boolean markedPure()Returns the value of themarkedPurerecord component.- Returns:
- the value of the
markedPurerecord component
-
requiresArgument
public boolean requiresArgument()Returns the value of therequiresArgumentrecord component.- Returns:
- the value of the
requiresArgumentrecord component
-
hasReturn
public boolean hasReturn()Returns the value of thehasReturnrecord component.- Returns:
- the value of the
hasReturnrecord component
-