Package org.geotools.filter.expression

Examples of org.geotools.filter.expression.AddImpl.evaluate()


    // Test addition
    MathExpressionImpl mathTest = new AddImpl(null, null);
    mathTest.setExpression1(testAttribute1);
    mathTest.setExpression2(testAttribute2);

    assertEquals(new Integer(6), mathTest.evaluate(testObject,
        Integer.class));

    // Test subtraction
    mathTest = new SubtractImpl(null, null);
    mathTest.setExpression1(testAttribute1);
View Full Code Here


    // Test subtraction
    mathTest = new SubtractImpl(null, null);
    mathTest.setExpression1(testAttribute1);
    mathTest.setExpression2(testAttribute2);

    assertEquals(new Integer(2), mathTest.evaluate(testObject,
        Integer.class));

    // Test multiplication
    mathTest = new MultiplyImpl(null, null);
    mathTest.setExpression1(testAttribute1);
View Full Code Here

    // Test multiplication
    mathTest = new MultiplyImpl(null, null);
    mathTest.setExpression1(testAttribute1);
    mathTest.setExpression2(testAttribute2);

    assertEquals(new Integer(8), mathTest.evaluate(testObject,
        Integer.class));

    // Test division
    mathTest = new DivideImpl(null, null);
    mathTest.setExpression1(testAttribute1);
View Full Code Here

    // Test division
    mathTest = new DivideImpl(null, null);
    mathTest.setExpression1(testAttribute1);
    mathTest.setExpression2(testAttribute2);

    assertEquals(new Double(2), mathTest.evaluate(testObject));
  }
}
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.