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 - OperationInstr: 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 aLogicalOperationContextrecord 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.opcode()Returns the value of theopcoderecord component.Returns the value of theoperationrecord component.result()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LogicalOperationContext
public LogicalOperationContext(IROpcode opcode, String result, LogicalOperationInstr.Operation operation) Creates an instance of aLogicalOperationContextrecord class.- Parameters:
opcode- the value for theopcoderecord componentresult- the value for theresultrecord componentoperation- the value for theoperationrecord 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 theopcoderecord component.- Returns:
- the value of the
opcoderecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
operation
Returns the value of theoperationrecord component.- Returns:
- the value of the
operationrecord component
-