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 aOperatorDetails
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of thehasReturn
record component.Returns the value of themappedName
record component.boolean
Returns the value of themarkedPure
record component.operator()
Returns the value of theoperator
record component.boolean
Returns the value of therequiresArgument
record component.final String
toString()
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 aOperatorDetails
record class.- Parameters:
operator
- the value for theoperator
record componentmappedName
- the value for themappedName
record componentmarkedPure
- the value for themarkedPure
record componentrequiresArgument
- the value for therequiresArgument
record componenthasReturn
- the value for thehasReturn
record 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 thecompare
method from their corresponding wrapper classes. -
operator
Returns the value of theoperator
record component.- Returns:
- the value of the
operator
record component
-
mappedName
Returns the value of themappedName
record component.- Returns:
- the value of the
mappedName
record component
-
markedPure
public boolean markedPure()Returns the value of themarkedPure
record component.- Returns:
- the value of the
markedPure
record component
-
requiresArgument
public boolean requiresArgument()Returns the value of therequiresArgument
record component.- Returns:
- the value of the
requiresArgument
record component
-
hasReturn
public boolean hasReturn()Returns the value of thehasReturn
record component.- Returns:
- the value of the
hasReturn
record component
-