Package org.nutz.el.arithmetic

Examples of org.nutz.el.arithmetic.ShuntingYard


public class RPNTest {
  private ShuntingYard sy = null;
 
  @Before
  public void setup(){
    sy = new ShuntingYard();
  }
View Full Code Here


  public El(){}
  /**
   * 预编译
   */
  public El(CharSequence cs){
    ShuntingYard sy = new ShuntingYard();
    Queue<Object> rpn = sy.parseToRPN(cs.toString());
    rc = new RPN(rpn);
  }
View Full Code Here

    //逆波兰表示法(Reverse Polish notation,RPN,或逆波兰记法)
    return eval(null, val);
  }

  public static Object eval(Context context, String val) {
    ShuntingYard sy = new ShuntingYard();
    RPN rc = new RPN();
    Queue<Object> rpn = sy.parseToRPN(val);
    return rc.calculate(context, rpn);
  }
View Full Code Here

public class RPNTest {
    private ShuntingYard sy = null;
   
    @Before
    public void setup(){
        sy = new ShuntingYard();
    }
View Full Code Here

    /**
     * 预编译
     */
    public El(CharSequence cs){
        elstr = cs;
        ShuntingYard sy = new ShuntingYard();
        Queue<Object> rpn = sy.parseToRPN(cs.toString());
        rc = new RPN(rpn);
    }
View Full Code Here

        //逆波兰表示法(Reverse Polish notation,RPN,或逆波兰记法)
        return eval(null, val);
    }

    public static Object eval(Context context, String val) {
        ShuntingYard sy = new ShuntingYard();
        RPN rc = new RPN();
        Queue<Object> rpn = sy.parseToRPN(val);
        return rc.calculate(context, rpn);
    }
View Full Code Here

TOP

Related Classes of org.nutz.el.arithmetic.ShuntingYard

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.