package de.dhbwstuttgart.syntaxtree.statement; import java.util.ArrayList; import java.util.List; import org.antlr.v4.runtime.Token; import de.dhbwstuttgart.syntaxtree.StatementVisitor; import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric; public class Switch extends Statement { private Expression switchedExpression; private List blocks = new ArrayList<>(); public Switch(Expression switched, List blocks, RefTypeOrTPHOrWildcardOrGeneric type, Boolean isStatement, Token offset) { super(type, offset); if (isStatement) setStatement(); this.switchedExpression = switched; this.blocks = blocks; } public Expression getSwitch() { return switchedExpression; } public List getBlocks() { return blocks; } @Override public void accept(StatementVisitor visitor) { visitor.visit(this); } }