Package org.jamesii.core.math.parsetree

Examples of org.jamesii.core.math.parsetree.ValueNode


  @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) {
View Full Code Here

TOP

Related Classes of org.jamesii.core.math.parsetree.ValueNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.