Class EnumSwitchCase

java.lang.Object
org.jfuncmachine.compiler.model.SourceElement
org.jfuncmachine.compiler.model.expr.EnumSwitchCase

public class EnumSwitchCase extends SourceElement
Defines a case value for an enum switch statement containing a target value and an expression to be executed if the switch value matches the case value.
  • Field Details

    • target

      public final String target
      The string name of an enum value of the switch target's enum class
    • expr

      public final Expression expr
      The expression to execute if the switch value equals this case value
  • Constructor Details

    • EnumSwitchCase

      public EnumSwitchCase(String target, Expression expr)
      Create a switch case that matches an enum field
      Parameters:
      target - The enum name that this case matches
      expr - The expression to execute if the switch value equals this case value
    • EnumSwitchCase

      public EnumSwitchCase(String target, Expression expr, String filename, int lineNumber)
      Create a switch case that matches an enum field
      Parameters:
      target - The enum name that this case matches
      expr - The expression to execute if the switch value equals this case value
      filename - The source filename containing this case
      lineNumber - The line number in the source filename where this case starts