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

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


    //SensorLookup lookup = new SensorLookupImpl(map);

    try {
      Vector v = new Vector();
      v.add(new ShortConstant(sn1));
      Expression e1 = new Rint(v,true);

      v.clear();
      v.add(new IntegerConstant(in1));
      Expression e2 = new Rint(v,true);

      v.clear();
      v.add(new LongConstant(ln1));
      Expression e3 = new Rint(v,true);

      v.clear();
      v.add(new FloatConstant(fn1));
      Expression e4 = new Rint(v,true);

      v.clear();
      v.add(new DoubleConstant(dn1));
      Expression e5 = new Rint(v,true);

      assertTrue(
        (Math.rint(sn1) - ((Number) e1.evaluate()).shortValue())
          == 0);
      assertTrue(
        (Math.rint(in1) - ((Number) e2.evaluate()).intValue())
          == 0);
      assertTrue(
          (Math.rint(ln1) - ((Number) e3.evaluate()).intValue())
            == 0);
      assertTrue(
        (Math.rint(fn1) - ((Number) e4.evaluate()).intValue())
          == 0);
      assertTrue(
        (Math.rint(dn1) - ((Number) e5.evaluate()).longValue())
          == 0);
/*
      assertSame((new Double(sn1)).getClass(), (e1.evaluate()).getClass());
      assertSame((new Double(in1)).getClass(), (e2.evaluate()).getClass());
      assertSame((new Double(ln1)).getClass(), (e3.evaluate()).getClass());
View Full Code Here

TOP

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

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.