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

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


    case SPLTreeParserTokenTypes.DIV:
      returnExpr = new Division(exprList, validateExpr);
      break;

    case SPLTreeParserTokenTypes.STAR:
      returnExpr = new Product(exprList, validateExpr);
      break;

    }

    logger.exiting(sourceClass, Thread.currentThread().getName() + " "
View Full Code Here


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

            v.clear();
          
            v.add(new IntegerConstant(in2));
            v.add(new IntegerConstant(in3));
            Expression ei = new Product(v,true);

            v.clear();
          
            v.add(new LongConstant(ln2));
            v.add(new LongConstant(ln3));
            Expression el = new Product(v,true);

            v.clear();
           
            v.add(new FloatConstant(fn2));
            v.add(new FloatConstant(fn3));
            Expression ef = new Product(v,true);

            v.clear();
           
            v.add(new DoubleConstant(dn2));
            v.add(new DoubleConstant(dn3));
            Expression ed = new Product(v,true);

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

      v.clear();
      v.add(propertySensor1);
      v.add(propertySensor2);
      Expression eps1 = new Product(v,true);
     
      v.clear();
      v.add(propertySensor3);
      v.add(propertySensor4);
      Expression eps2 = new Product(v,true);

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

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

      v.clear();
      v.add(propertySensor9);
      v.add(propertySensor10);
      Expression eps5 = new Product(v,true);
     
            assertTrue(
                ((sn2 * sn3)
                    - ((Number) es.evaluate()).shortValue())
                    == 0);
            assertTrue(
                ((in2 * in3)
                  - ((Number) ei.evaluate()).intValue())
                    == 0);
            assertTrue(
                ((ln2 * ln3)
                    - ((Number) el.evaluate()).longValue())
                    == 0);
            assertTrue(
                ((fn2 * fn3)
                    - ((Number) ef.evaluate()).floatValue())
                    == 0);
            assertTrue(
                ((dn2 * dn3)
                    - ((Number) ed.evaluate()).doubleValue())
                    == 0);
            assertTrue(((sn1*in1) - ((Number)emix1.evaluate()).doubleValue()) == 0);

            assertTrue(((ln1*fn1) - ((Number)emix2.evaluate()).doubleValue()) == 0);
           //System.out.println("(fn1*dn1) = "+(fn1*dn1));
           //System.out.println("((Number)emix2.evaluate()).doubleValue()) = "+((Number)emix3.evaluate()).doubleValue());
           
            assertTrue(((fn1*dn1) - ((Number)emix3.evaluate()).doubleValue()) == 0);

      assertTrue(
        ((sn1 * sn2)
          - ((Number) eps1.evaluate()).shortValue())
          == 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());
 
View Full Code Here

TOP

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

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.