Record Class ForRangePolymorphicInstr.EqualCase
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.instructions.ForRangePolymorphicInstr.EqualCase
- Enclosing class:
ForRangePolymorphicInstr
public static record ForRangePolymorphicInstr.EqualCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopBodySetup, boolean singleIteration)
extends Record
Dispatch case for equal loops (direction == 0).
Single iteration only - no condition checking or increment needed.
Example: for i in 5 ... 5
Just setup loop variable and execute body once
Includes direction check (direction == 0) to prevent fall-through execution when
BY validation fails for ascending/descending cases. Without this check,
for i in 10 ... 1 by 2 would incorrectly execute the equal case.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedirectionCheckrecord component.Returns the value of thedirectionPrimitiverecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theloopBodySetuprecord component.booleanReturns the value of thesingleIterationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EqualCase
public EqualCase(List<IRInstr> directionCheck, String directionPrimitive, List<IRInstr> loopBodySetup, boolean singleIteration) Creates an instance of aEqualCaserecord class.- Parameters:
directionCheck- the value for thedirectionCheckrecord componentdirectionPrimitive- the value for thedirectionPrimitiverecord componentloopBodySetup- the value for theloopBodySetuprecord componentsingleIteration- the value for thesingleIterationrecord 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. -
directionCheck
-
directionPrimitive
Returns the value of thedirectionPrimitiverecord component.- Returns:
- the value of the
directionPrimitiverecord component
-
loopBodySetup
-
singleIteration
public boolean singleIteration()Returns the value of thesingleIterationrecord component.- Returns:
- the value of the
singleIterationrecord component
-