Record Class EvaluationVariableDetails
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.EvaluationVariableDetails
public record EvaluationVariableDetails(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup)
extends Record
Record containing evaluation variable management information for CONTROL_FLOW_CHAIN constructs.
Evaluation variables are used in switch statements where the switch expression is computed and stored in a variable for comparison against case conditions: - switch statements: "switch someVar" or "switch var := expr" - switch expressions: "result <- switch someVar"
For if/else statements and Question operators, evaluation variables are not used since conditions are evaluated directly as boolean expressions.
-
Constructor Summary
ConstructorsConstructorDescriptionEvaluationVariableDetails(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup) Creates an instance of aEvaluationVariableDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theevaluationVariablerecord component.Returns the value of theevaluationVariableSetuprecord component.Returns the value of theevaluationVariableTyperecord component.static EvaluationVariableDetailsforVariable(String evaluationVariable, String evaluationVariableType) Create evaluation variable details for existing variable.booleanCheck if this has an evaluation variable.final inthashCode()Returns a hash code value for this object.booleanCheck if this has setup instructions.booleanisEmpty()Check if this evaluation details object is empty (no evaluation variable).static EvaluationVariableDetailsnone()Create empty evaluation variable details (no evaluation variable).toString()IR-optimized toString following EK9's bracket-only, no-indentation format.static EvaluationVariableDetailswithSetup(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup) Create evaluation variable details with setup instructions.
-
Constructor Details
-
EvaluationVariableDetails
public EvaluationVariableDetails(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup) Creates an instance of aEvaluationVariableDetailsrecord class.- Parameters:
evaluationVariable- the value for theevaluationVariablerecord componentevaluationVariableType- the value for theevaluationVariableTyperecord componentevaluationVariableSetup- the value for theevaluationVariableSetuprecord component
-
-
Method Details
-
none
Create empty evaluation variable details (no evaluation variable). -
forVariable
public static EvaluationVariableDetails forVariable(String evaluationVariable, String evaluationVariableType) Create evaluation variable details for existing variable. -
withSetup
public static EvaluationVariableDetails withSetup(String evaluationVariable, String evaluationVariableType, List<IRInstr> evaluationVariableSetup) Create evaluation variable details with setup instructions. -
hasEvaluationVariable
public boolean hasEvaluationVariable()Check if this has an evaluation variable. -
hasSetupInstructions
public boolean hasSetupInstructions()Check if this has setup instructions. -
isEmpty
public boolean isEmpty()Check if this evaluation details object is empty (no evaluation variable). -
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). -
evaluationVariable
Returns the value of theevaluationVariablerecord component.- Returns:
- the value of the
evaluationVariablerecord component
-
evaluationVariableType
Returns the value of theevaluationVariableTyperecord component.- Returns:
- the value of the
evaluationVariableTyperecord component
-
evaluationVariableSetup
-