Examples of evaluate()


Examples of org.opengis.filter.PropertyIsGreaterThan.evaluate()

        Expression left = ff.literal(2);
        Expression right = ff.literal(1);
       
        PropertyIsGreaterThan filter = ff.greater( left, right );
       
        assertTrue( filter.evaluate( null ) );
        assertTrue( filter instanceof PropertyIsGreaterThan );
    }
}

Examples of org.opengis.filter.PropertyIsLessThan.evaluate()

        Expression leftExpr = lessThan.getExpression1();
        Expression rightExpr = lessThan.getExpression2();
        System.out.println("left expression value: " + leftExpr.evaluate(city));
        System.out.println("right expression value: " + rightExpr.evaluate(city));
       
        Boolean result = lessThan.evaluate(city);
        System.out.println("Result of filter evaluation: " + result);
    }
   
    private static void betweenPredicate() throws Exception {
       

Examples of org.opengis.filter.PropertyIsLike.evaluate()

        // Set up string
        testAttribute = new AttributeExpressionImpl(testSchema, "testString");

        PropertyIsLike filter = fac.like(testAttribute, "test*", "*", ".", "!");
        assertTrue(filter.evaluate(testFeature));

        // Test for false positive.
        filter = fac.like(testAttribute, "cows*", "*", ".", "!");
        assertFalse(filter.evaluate(testFeature));

Examples of org.opengis.filter.PropertyIsNotEqualTo.evaluate()

  public void testOperandsSameType() {
    Expression e1 = filterFactory.literal( 1 );
    Expression e2 = filterFactory.literal( 2 );
   
    PropertyIsNotEqualTo notEqual = filterFactory.notEqual( e1, e2, true );
    assertTrue( notEqual.evaluate( null ) );
  }
 
  public void testOperandsDifferentType() {
    Expression e1 = filterFactory.literal( 1 );
    Expression e2 = filterFactory.literal( "2"

Examples of org.opengis.filter.PropertyIsNull.evaluate()

    public void testNull() throws IllegalFilterException {
        // Test for false positive.
        PropertyName testAttribute = new AttributeExpressionImpl(testSchema, "testString");

        PropertyIsNull filter = fac.isNull(org.opengis.filter.expression.Expression.NIL);
        assertTrue(filter.evaluate(testFeature));
       
        filter = fac.isNull(testAttribute);
        assertFalse(filter.evaluate(testFeature));
    }
   

Examples of org.opengis.filter.expression.Expression.evaluate()

        Expression fontFamilyExpression = font.getFamily().get(0);
        Expression sizeExpression = font.getSize();
        if (sizeExpression == null || fontFamilyExpression == null)
            return null;

        Double size = sizeExpression.evaluate(null, Double.class);

        try {
            String fontFamily = fontFamilyExpression.evaluate(null, String.class);
            tempFD[0] = new FontData(fontFamily, size.intValue(), 1);
        } catch (NullPointerException ignore) {

Examples of org.opengis.filter.expression.Function.evaluate()

     */
    public void testToDirectPosition() throws Exception {
        // 2 points with SRS
        Function function = ff.function("toDirectPosition", ToDirectPositionFunction.SRS_NAME,
                ff.literal("EPSG:4326"), pointOne, pointTwo);
        Object value = function.evaluate(feature);
        assertTrue(value instanceof DirectPosition);
        DirectPosition pos = (DirectPosition) value;
        assertEquals(CRS.toSRS(pos.getCoordinateReferenceSystem()), "EPSG:4326");
        assertEquals(pos.getDimension(), 2);
        assertEquals(pos.getOrdinate(0), 5.0, 0);

Examples of org.opengis.filter.expression.Literal.evaluate()

            refreshControls(null, name, null);
            feedback();
            return;
        } else if (expr instanceof Literal) {
            Literal literal = (Literal) expr;
            Double percent = literal.evaluate(null, Double.class);
            if (percent != null) {
                refreshControls(percent, null, null);
                feedback();
                return;
            }

Examples of org.opengis.filter.expression.PropertyName.evaluate()

                }
                else {
                    propertyName = ff.property( name.getLocalPart() );
                }
               
                if ( propertyName.evaluate( featureType ) == null ) {
                    String msg = "No such property: " + property.getName();
                    throw new WFSException( msg );
                }
            }
        } catch (IOException e) {

Examples of org.opengis.filter.spatial.BBOX.evaluate()

        int expected = 0;
        SimpleFeatureIterator features = fs.getFeatures().features();
        try {
            while (features.hasNext()) {
                SimpleFeature next = features.next();
                if (bboxFilter.evaluate(next)) {
                    expected++;
                }
            }
        } finally {
            features.close();
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.