@SuppressWarnings({ "unchecked", "cast", "rawtypes" })
@Override
public <N extends INode> N calc(IEnvironment<?> cEnv) {
ValueNode val = caseStmt.calc(cEnv);
INode defaultExpr = null;
for (Pair<? extends Comparable, INode> p : caseTerms) {
// default case
if (p.getFirstValue() == null) {
defaultExpr = p.getSecondValue();
// continue with checking all other cases
continue;
}
// any other than default case
if (p.getFirstValue().compareTo(val.getValue()) == 0) {
return (N) p.getSecondValue().calc(cEnv);
}
}
if (defaultExpr != null) {