Package org.yaac.server.egql.evaluator

Examples of org.yaac.server.egql.evaluator.MultiplyEvaluator


    Assert.assertEquals(new DecimalEvaluator("1"), parser("+++++++1").unary().e);
  }
 
  @Test
  public void testMult() throws Exception {
    Assert.assertEquals(new MultiplyEvaluator(new DecimalEvaluator("1"), new DecimalEvaluator("2")),
        parser("1*2").mult().e);
   
    Assert.assertEquals(new DivideEvaluator(new DecimalEvaluator("1"), new DecimalEvaluator("2")),
        parser("1/2").mult().e);
   
    Assert.assertEquals(new DivideEvaluator(new NegationEvaluator(new DecimalEvaluator("1")), new DecimalEvaluator("2")),
        parser("-1 / 2").mult().e);
   
    Assert.assertEquals(new MultiplyEvaluator(new MultiplyEvaluator(
        new DecimalEvaluator("1"), new DecimalEvaluator("2")), new DecimalEvaluator("3")),
        parser("1*2*3").mult().e);
   
    Assert.assertEquals(new DivideEvaluator(
        new NegationEvaluator(new DecimalEvaluator("1")),
View Full Code Here


   
    Assert.assertEquals(new SubtractEvaluator(new DecimalEvaluator("1"), new DecimalEvaluator("2")),
        parser("1-2").expression().e);
   
    Assert.assertEquals(new SubtractEvaluator(
        new MultiplyEvaluator(new DecimalEvaluator("1"), new DecimalEvaluator("2")),
        new DecimalEvaluator("2")),
        parser("1*2-2").expression().e);
   
    Assert.assertEquals(new AddEvaluator(
        new MultiplyEvaluator(new DecimalEvaluator("1"), new DecimalEvaluator("2")),
        new MultiplyEvaluator(new DecimalEvaluator("3"), new DecimalEvaluator("4"))),
        parser("1*2 + 3 * 4").expression().e);
  }
 
View Full Code Here

        parser("1*2 + 3 * 4").expression().e);
  }
 
  @Test
  public void testNestedExpression() throws Exception {
    Assert.assertEquals(new MultiplyEvaluator(
        new AddEvaluator(new DecimalEvaluator("2"), new DecimalEvaluator("3")),
        new DecimalEvaluator("4")),
        parser("(2 + 3) * 4").expression().e);
  }
 
View Full Code Here

TOP

Related Classes of org.yaac.server.egql.evaluator.MultiplyEvaluator

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.