Record Class LogicalOperationContext
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.support.LogicalOperationContext
public record LogicalOperationContext(IROpcode opcode, String result, LogicalOperationInstr.Operation operation)
extends Record
Record to group logical operation context information.
This pattern centralizes operation metadata that defines the identity and result of a logical operation (AND/OR): - IROpcode: The specific IR operation code (LOGICAL_AND_BLOCK/LOGICAL_OR_BLOCK) - Result: The variable name that will hold the operation result - Operation: The logical operation type (AND/OR enum)
Provides a foundation for consistent operation context handling across logical operations and future similar constructs.
-
Constructor Summary
ConstructorsConstructorDescriptionLogicalOperationContext
(IROpcode opcode, String result, LogicalOperationInstr.Operation operation) Creates an instance of aLogicalOperationContext
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.opcode()
Returns the value of theopcode
record component.Returns the value of theoperation
record component.result()
Returns the value of theresult
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LogicalOperationContext
public LogicalOperationContext(IROpcode opcode, String result, LogicalOperationInstr.Operation operation) Creates an instance of aLogicalOperationContext
record class.- Parameters:
opcode
- the value for theopcode
record componentresult
- the value for theresult
record componentoperation
- the value for theoperation
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
opcode
Returns the value of theopcode
record component.- Returns:
- the value of the
opcode
record component
-
result
Returns the value of theresult
record component.- Returns:
- the value of the
result
record component
-
operation
Returns the value of theoperation
record component.- Returns:
- the value of the
operation
record component
-