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

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


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

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

    case SPLTreeParserTokenTypes.DIV:
      returnExpr = new Division(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 Subtraction(v,true);

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

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

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

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

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new IntegerConstant(in1));
            Expression emix1 = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new LongConstant(ln1));
            Expression emix2 = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new FloatConstant(fn1));
            Expression emix3 = new Subtraction(v,true);

            v.clear();
            v.add(new ShortConstant(sn1));
            v.add(new DoubleConstant(dn1));
            Expression emix4 = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new LongConstant(ln1));
            Expression emix5 = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new FloatConstant(fn1));
            Expression emix6 = new Subtraction(v,true);

            v.clear();
            v.add(new IntegerConstant(in1));
            v.add(new DoubleConstant(dn1));
            Expression emix7 = new Subtraction(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new FloatConstant(fn1));
            Expression emix8 = new Subtraction(v,true);

            v.clear();
            v.add(new LongConstant(ln1));
            v.add(new DoubleConstant(dn1));
            Expression emix9 = new Subtraction(v,true);

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

      v.clear();
      v.add(propertySensor1);
      v.add(propertySensor2);
      Expression eps1 = new Subtraction(v,true);

      v.clear();
      v.add(propertySensor3);
      v.add(propertySensor4);
      Expression eps2 = new Subtraction(v,true);

      v.clear();
      v.add(propertySensor5);
      v.add(propertySensor6);
      Expression eps3 = new Subtraction(v,true);

      v.clear();
      v.add(propertySensor7);
      v.add(propertySensor8);
      Expression eps4 = new Subtraction(v,true);

      v.clear();
      v.add(propertySensor9);
      v.add(propertySensor10);
      Expression eps5 = new Subtraction(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()).intValue())
                    == 0);
            assertTrue(
                ((sn1 - ln1) - ((Number) emix2.evaluate()).longValue())
                    == 0);
            assertTrue(
                ((sn1 - fn1) - ((Number) emix3.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((sn1 - dn1) - ((Number) emix4.evaluate()).doubleValue())
                    == 0);
            assertTrue(
                ((in1 - ln1) - ((Number) emix5.evaluate()).longValue())
                    == 0);
            assertTrue(
                ((in1 - fn1) - ((Number) emix6.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((in1 - dn1) - ((Number) emix7.evaluate()).doubleValue())
                    == 0);
            assertTrue(
                ((ln1 - fn1) - ((Number) emix8.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((ln1 - dn1) - ((Number) emix9.evaluate()).doubleValue())
                    == 0);
            assertTrue(
                ((fn1 - dn1)
                    - ((Number) emix10.evaluate()).doubleValue())
                    == 0);
                   
      assertTrue(
        ((sn1 - sn2)
          - ((Number) eps1.evaluate()).intValue())
          == 0);
      assertTrue(
        ((in1 - in2)
          - ((Number) eps2.evaluate()).intValue())
          == 0);
      assertTrue(
        ((ln1 - ln2)
          - ((Number) eps3.evaluate()).longValue())
          == 0);
      assertTrue(
        ((fn1 - fn2)
          - ((Number) eps4.evaluate()).floatValue())
          == 0);
      assertTrue(
        ((dn1 - dn2)
          - ((Number) eps5.evaluate()).doubleValue())
          == 0);
    /* 
//      assertSame((new Integer(sn1 - sn2)).getClass(),
//          (eps1.evaluate()).getClass());
      assertSame((new Integer(in1 - in2)).getClass(),
View Full Code Here

TOP

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

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.