Record Class ASTStmtSwitch.SwitchCase
java.lang.Object
java.lang.Record
io.github.protasm.jvmud.compiler.parser.ast.stmt.ASTStmtSwitch.SwitchCase
- Record Components:
expression- the exact case value or inclusive range start;nullfor defaultrangeEndExpression- the inclusive range end forcase start..end:, otherwisenull
- Enclosing class:
ASTStmtSwitch
public static record ASTStmtSwitch.SwitchCase(int line, ASTExpression expression, ASTExpression rangeEndExpression, boolean isDefault, List<ASTStatement> statements)
extends Record
One
case or default label and the statements owned by that label.-
Constructor Summary
ConstructorsConstructorDescriptionSwitchCase(int line, ASTExpression expression, boolean isDefault, List<ASTStatement> statements) SwitchCase(int line, ASTExpression expression, ASTExpression rangeEndExpression, boolean isDefault, List<ASTStatement> statements) Creates an instance of aSwitchCaserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpressionrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisDefaultrecord component.booleanisRange()intline()Returns the value of thelinerecord component.Returns the value of therangeEndExpressionrecord component.Returns the value of thestatementsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SwitchCase
public SwitchCase(int line, ASTExpression expression, ASTExpression rangeEndExpression, boolean isDefault, List<ASTStatement> statements) Creates an instance of aSwitchCaserecord class.- Parameters:
line- the value for thelinerecord componentexpression- the value for theexpressionrecord componentrangeEndExpression- the value for therangeEndExpressionrecord componentisDefault- the value for theisDefaultrecord componentstatements- the value for thestatementsrecord component
-
SwitchCase
public SwitchCase(int line, ASTExpression expression, boolean isDefault, List<ASTStatement> statements)
-
-
Method Details
-
isRange
public boolean isRange() -
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. -
line
public int line()Returns the value of thelinerecord component.- Returns:
- the value of the
linerecord component
-
expression
Returns the value of theexpressionrecord component.- Returns:
- the value of the
expressionrecord component
-
rangeEndExpression
Returns the value of therangeEndExpressionrecord component.- Returns:
- the value of the
rangeEndExpressionrecord component
-
isDefault
public boolean isDefault()Returns the value of theisDefaultrecord component.- Returns:
- the value of the
isDefaultrecord component
-
statements
Returns the value of thestatementsrecord component.- Returns:
- the value of the
statementsrecord component
-