Package org.apache.imperius.spl.parser.expressions.impl

Examples of org.apache.imperius.spl.parser.expressions.impl.Addition


    case SPLTreeParserTokenTypes.GE:
      returnExpr = new GreaterOrEqual(exprList, validateExpr);
      break;

    case SPLTreeParserTokenTypes.PLUS:
      returnExpr = new Addition(exprList, validateExpr);
      break;

    case SPLTreeParserTokenTypes.MINUS:
      returnExpr = new Subtraction(exprList, validateExpr);
      break;
View Full Code Here


        try {
            Vector v = new Vector();
            v.add(new ShortConstant(sn1));
            v.add(new ShortConstant(sn2));
           
            Expression es = new Addition(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new IntegerConstant(in2));
           
            Expression ei = new Addition(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new LongConstant(ln2));
          
            Expression el = new Addition(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            v.add(new FloatConstant(fn2));
           
            Expression ef = new Addition(v,true);

            v.clear();
            v.add(new DoubleConstant(dn1));
            v.add(new DoubleConstant(dn2));
          
            Expression ed = new Addition(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new IntegerConstant(in1));
           
            Expression emix1 = new Addition(v,true);
           
            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new FloatConstant(fn1));
            Expression emix2 = new Addition(v,true);

            v.clear();
            v.add(new FloatConstant(fn1));
            v.add(new DoubleConstant(dn1));
            Expression emix3 = new Addition(v,true);


            v.clear();
          
            v.add(propertySensor2);
            v.add(new ShortConstant(sn3));
            Expression eps1 = new Addition(v,true);

            v.clear();
            v.add(propertySensor4);
            v.add(new IntegerConstant(in3));
            Expression eps2 = new Addition(v,true);

            v.clear();
           
            v.add(propertySensor6);
            v.add(new LongConstant(ln3));
            Expression eps3 = new Addition(v,true);

            v.clear();
           
            v.add(propertySensor8);
            v.add(new FloatConstant(fn3));
            Expression eps4 = new Addition(v,true);

            v.clear();
          
            v.add(propertySensor10);
            v.add(new DoubleConstant(dn3));
            Expression eps5 = new Addition(v,true);

            assertTrue(
                ((sn1 + sn2)
                    - ((Number) es.evaluate()).shortValue())
                    == 0);
            assertTrue(
                ((in1 + in2) - ((Number) ei.evaluate()).intValue())
                    == 0);
            assertTrue(
                ((ln1 + ln2)
                    - ((Number) el.evaluate()).longValue())
                    == 0);
            assertTrue(
                ((fn1 + fn2)
                    - ((Number) ef.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((dn1 + dn2)
                    - ((Number) ed.evaluate()).doubleValue())
                    == 0);
      assertTrue(
        ((sn1+in1)
          - ((Number) emix1.evaluate()).doubleValue())
          == 0);
      assertTrue(
          (( ln1+fn1)
            - ((Number) emix2.evaluate()).doubleValue())
            == 0);
      assertTrue(
          ((fn1+dn1)
            - ((Number) emix3.evaluate()).doubleValue())
            == 0);

            assertTrue(
                ((sn2 + sn3)
                    - ((Number) eps1.evaluate()).shortValue())
                    == 0);
            assertTrue(
                ((in2 + in3)
                    - ((Number) eps2.evaluate()).intValue())
                    == 0);
            assertTrue(
                ((ln2 + ln3)
                    - ((Number) eps3.evaluate()).longValue())
                    == 0);
            assertTrue(
                ((fn2 + fn3)
                    - ((Number) eps4.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((dn2 + dn3)
                    - ((Number) eps5.evaluate()).doubleValue())
                    == 0);
/*
            assertSame(
                (eps1.evaluate()).getClass(),
                (new Integer(sn1)).getClass());
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.parser.expressions.impl.Addition

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.