Examples of FloatConstant


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

        }
    }

    public void checkGreaterExpressionWithNumericArgumentsFloatAgainstDouble() {
        //HashMap map = new HashMap();
        propertySensor1=new FloatConstant(20);
        propertySensor2=new DoubleConstant(5);
        propertySensor3=new DoubleConstant(-20);
        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 > Property2 (20 > 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new Greater(v,true);

            // Property3 > Property1 (-20 > 20) = false   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new Greater(v,true);

            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(5));
            Expression expression3 = new Greater(v,true);

            v.clear();
            v.add(new FloatConstant(-20));
            v.add(new DoubleConstant(20));
            Expression expression4 = new Greater(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
View Full Code Here

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

    }

    public void checkGreaterOrEqualExpressionWithNumericArgumentsShortAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new ShortConstant((short) 20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        propertySensor4=new FloatConstant(20);

        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 > Property2 (20 > 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new GreaterOrEqual(v,true);

            // Property3 > Property1 (-20 > 20) = false   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new GreaterOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new GreaterOrEqual(v,true);

            // Property1 > 5 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant((short) 5));
            Expression expression4 = new GreaterOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant((short) 20));
            Expression expression5 = new GreaterOrEqual(v,true);

            //-20 > 20 (false)
            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new FloatConstant((short) 20));
            Expression expression6 = new GreaterOrEqual(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

    }

    public void checkGreaterOrEqualExpressionWithNumericArgumentsIntegerAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new IntegerConstant(20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        propertySensor4=new FloatConstant(20);

        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 > Property2 (20 > 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new GreaterOrEqual(v,true);

            // Property3 > Property1 (-20 > 20) = false   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new GreaterOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new GreaterOrEqual(v,true);

            // Property1 > 5 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant((short) 5));
            Expression expression4 = new GreaterOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant((short) 20));
            Expression expression5 = new GreaterOrEqual(v,true);

            //-20 > 20 (false)
            v.clear();
            v.add(new IntegerConstant((short) - 20));
            v.add(new FloatConstant((short) 20));
            Expression expression6 = new GreaterOrEqual(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

    }

    public void checkGreaterOrEqualExpressionWithNumericArgumentsLongAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new LongConstant(20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        propertySensor4=new FloatConstant(20);

        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 > Property2 (20 > 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new GreaterOrEqual(v,true);

            // Property3 > Property1 (-20 > 20) = false   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new GreaterOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new GreaterOrEqual(v,true);

            // Property1 > 5 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression4 = new GreaterOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(20));
            Expression expression5 = new GreaterOrEqual(v,true);

            //-20 > 20 (false)
            v.clear();
            v.add(new LongConstant(-20));
            v.add(new FloatConstant(20));
            Expression expression6 = new GreaterOrEqual(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

        }
    }

    public void checkGreaterOrEqualExpressionWithNumericArgumentsFloatAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new FloatConstant(20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        propertySensor4=new FloatConstant(20);

        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 > Property2 (20 > 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new GreaterOrEqual(v,true);

            // Property3 > Property1 (-20 > 20) = false   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new GreaterOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new GreaterOrEqual(v,true);

            // Property1 > 5 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression4 = new GreaterOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(20));
            Expression expression5 = new GreaterOrEqual(v,true);

            //-20 > 20 (false)
            v.clear();
            v.add(new FloatConstant(-20));
            v.add(new FloatConstant(20));
            Expression expression6 = new GreaterOrEqual(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

        }
    }

    public void checkGreaterOrEqualExpressionWithNumericArgumentsFloatAgainstDouble() {
        //HashMap map = new HashMap();
        propertySensor1=new FloatConstant(20);
        propertySensor2=new DoubleConstant(5);
        propertySensor3=new DoubleConstant(-20);
        propertySensor4=new DoubleConstant(20);

        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 > Property2 (20 > 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor1);
            v.add(propertySensor2);
            Expression expression1 = new GreaterOrEqual(v,true);

            // Property3 > Property1 (-20 > 20) = false   
            v.clear();
            v.add(propertySensor3);
            v.add(propertySensor1);
            Expression expression2 = new GreaterOrEqual(v,true);

            // Property1 == Property4 (20 == 20) = true   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor4);
            Expression expression3 = new GreaterOrEqual(v,true);

            // Property1 > 5 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(5));
            Expression expression4 = new GreaterOrEqual(v,true);

            //Property1 == 20 (true)
            v.clear();
            v.add(propertySensor1);
            v.add(new DoubleConstant(20));
            Expression expression5 = new GreaterOrEqual(v,true);

            //-20 > 20 (false)
            v.clear();
            v.add(new FloatConstant(-20));
            v.add(new DoubleConstant(20));
            Expression expression6 = new GreaterOrEqual(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
View Full Code Here

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

    }

    public void checkLessExpressionWithNumericArgumentsShortAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new ShortConstant((short) 20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 < Property2 (20 < 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor2);
            v.add(propertySensor1);
            Expression expression1 = new Less(v,true);

            // Property1 < Property3 (20 < -20) = false   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor3);
            Expression expression2 = new Less(v,true);

            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression3 = new Less(v,true);

            v.clear();
            v.add(new ShortConstant((short) - 20));
            v.add(new FloatConstant(20));
            Expression expression4 = new Less(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

    }

    public void checkLessExpressionWithNumericArgumentsIntegerAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new IntegerConstant(20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 < Property2 (20 < 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor2);
            v.add(propertySensor1);
            Expression expression1 = new Less(v,true);

            // Property1 < Property3 (20 < -20) = false   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor3);
            Expression expression2 = new Less(v,true);

            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression3 = new Less(v,true);

            v.clear();
            v.add(new IntegerConstant(-20));
            v.add(new FloatConstant(20));
            Expression expression4 = new Less(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

    }

    public void checkLessExpressionWithNumericArgumentsLongAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new LongConstant(20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 < Property2 (20 < 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor2);
            v.add(propertySensor1);
            Expression expression1 = new Less(v,true);

            // Property1 < Property3 (20 < -20) = false   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor3);
            Expression expression2 = new Less(v,true);

            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression3 = new Less(v,true);

            v.clear();
            v.add(new LongConstant(-20));
            v.add(new FloatConstant(20));
            Expression expression4 = new Less(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here

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

        }
    }

    public void checkLessExpressionWithNumericArgumentsFloatAgainstFloat() {
        //HashMap map = new HashMap();
        propertySensor1=new FloatConstant(20);
        propertySensor2=new FloatConstant(5);
        propertySensor3=new FloatConstant(-20);
        //SensorLookup lookup = new SensorLookupImpl(map);

        // Property1 < Property2 (20 < 5) = true   
        try {
            Vector v = new Vector();
            v.add(propertySensor2);
            v.add(propertySensor1);
            Expression expression1 = new Less(v,true);

            // Property1 < Property3 (20 < -20) = false   
            v.clear();
            v.add(propertySensor1);
            v.add(propertySensor3);
            Expression expression2 = new Less(v,true);

            v.clear();
            v.add(propertySensor1);
            v.add(new FloatConstant(5));
            Expression expression3 = new Less(v,true);

            v.clear();
            v.add(new FloatConstant(-20));
            v.add(new FloatConstant(20));
            Expression expression4 = new Less(v,true);

            assertTrue(((Boolean) expression1.evaluate()).booleanValue());
            assertFalse(
                ((Boolean) expression2.evaluate()).booleanValue());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.