Package org.opengis.filter

Examples of org.opengis.filter.And


    public void testLogicFilterAnd() throws Exception {
        PropertyIsEqualTo equals = ff.equals(ff.property("measurement/result"), ff.literal(1.1));
        PropertyIsGreaterThan greater = ff.greater(ff
                .property("measurement/determinand_description"), ff.literal("desc1"));

        And logicFilter = ff.and(equals, greater);

        Filter unrolled = (Filter) logicFilter.accept(visitor, null);
        assertNotNull(unrolled);
        assertTrue(unrolled instanceof And);
        assertNotSame(equals, unrolled);

        And sourceAnd = (And) unrolled;
        assertEquals(2, sourceAnd.getChildren().size());

        Filter sourceEquals = (Filter) sourceAnd.getChildren().get(0);
        assertTrue(sourceEquals instanceof PropertyIsEqualTo);

        Expression left = ((PropertyIsEqualTo) sourceEquals).getExpression1();
        Expression right = ((PropertyIsEqualTo) sourceEquals).getExpression2();
        assertTrue(left instanceof PropertyName);
        assertTrue(right instanceof Literal);

        assertEquals("results_value", ((PropertyName) left).getPropertyName());
        assertEquals(new Double(1.1), ((Literal) right).getValue());

        Filter sourceGreater = (Filter) sourceAnd.getChildren().get(1);
        assertTrue(sourceGreater instanceof PropertyIsGreaterThan);

        left = ((PropertyIsGreaterThan) sourceGreater).getExpression1();
        right = ((PropertyIsGreaterThan) sourceGreater).getExpression2();
        assertTrue(left instanceof PropertyName);
View Full Code Here


    }

    public void testAndParse() throws Exception {
        FilterMockData.and(document, document);

        And and = (And) parse();

        assertEquals(2, and.getChildren().size());
    }
View Full Code Here

    }

    public void testAndParse() throws Exception {
        FilterMockData.and(document, document);

        And and = (And) parse();

        assertEquals(2, and.getChildren().size());
    }
View Full Code Here

    public void testAndWithLikeParse() throws Exception {
        Element e = FilterMockData.and(document, document, true);
        FilterMockData.propertyIsLike(document, e);
        FilterMockData.propertyIsLike(document, e);
       
        And and = (And) parse();
        assertEquals( 2, and.getChildren().size() );
        assertTrue( and.getChildren().get(0) instanceof PropertyIsLike );
        assertTrue( and.getChildren().get(1) instanceof PropertyIsLike );
    }
View Full Code Here

        assertTrue( and.getChildren().get(1) instanceof PropertyIsLike );
    }
   
    public void testAndWithLikeEncode() throws Exception {
        FilterFactory f = FilterMockData.f;
        And and = f.and( FilterMockData.propertyIsLike(), FilterMockData.propertyIsLike());
       
        Document dom = encode(and,OGC.And);
        assertEquals( 2, getElementsByQName(dom, OGC.PropertyIsLike).getLength() );
    }
View Full Code Here

    public void testAndWithNullParse() throws Exception {
        Element e = FilterMockData.and(document, document, true);
        FilterMockData.propertyisNull(document, e);
        FilterMockData.propertyisNull(document, e);
       
        And and = (And) parse();
        assertEquals( 2, and.getChildren().size() );
        assertTrue( and.getChildren().get(0) instanceof PropertyIsNull );
        assertTrue( and.getChildren().get(1) instanceof PropertyIsNull );
    }
View Full Code Here

        assertTrue( and.getChildren().get(1) instanceof PropertyIsNull );
    }
   
    public void testAndWithNullEncode() throws Exception {
        FilterFactory f = FilterMockData.f;
        And and = f.and( FilterMockData.propertyIsNull(), FilterMockData.propertyIsNull());
       
        Document dom = encode(and,OGC.And);
        assertEquals( 2, getElementsByQName(dom, OGC.PropertyIsNull).getLength() );
    }
View Full Code Here

    public void testAndWithBetweenParse() throws Exception {
        Element e = FilterMockData.and(document, document, true);
        FilterMockData.propertyIsBetween(document, e);
        FilterMockData.propertyIsBetween(document, e);
       
        And and = (And) parse();
        assertEquals( 2, and.getChildren().size() );
        assertTrue( and.getChildren().get(0) instanceof PropertyIsBetween );
        assertTrue( and.getChildren().get(1) instanceof PropertyIsBetween );
    }
View Full Code Here

        assertTrue( and.getChildren().get(1) instanceof PropertyIsBetween );
    }
   
    public void testAndWithBetweenEncode() throws Exception {
        FilterFactory f = FilterMockData.f;
        And and = f.and( FilterMockData.propertyIsBetween(), FilterMockData.propertyIsBetween());
       
        Document dom = encode(and,OGC.And);
        assertEquals( 2, getElementsByQName(dom, OGC.PropertyIsBetween).getLength() );
    }
View Full Code Here

        Literal end = period.getEnding();

        // creates and filter firstDate<= property <= lastDate
        Expression property = this.resultStack.popExpression();

        And filter = filterFactory.and(filterFactory.lessOrEqual(begin,
                property), filterFactory.lessOrEqual(property, end));

        return filter;
    }
View Full Code Here

TOP

Related Classes of org.opengis.filter.And

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.