Package org.opengis.filter

Examples of org.opengis.filter.Or


  public void testMassOrFilter() throws Exception {
      List filters = new ArrayList();
      for (int i = 0; i < 10000; i++) {
            filters.add(ff.equals(ff.property(nameAtt), ff.literal("" + i)));
        }
      Or orFilter = ff.or(filters);
      visitor = newVisitor(simpleLogicalCaps);
      // this would have throw the thing into a stack overflow error
        orFilter.accept(visitor, null);
        assertEquals(orFilter, visitor.getFilterPre());
        assertEquals(Filter.INCLUDE, visitor.getFilterPost());
  }
View Full Code Here


        // Set up false sub filter
        testLiteral = new LiteralExpressionImpl("incorrect test string data");
        PropertyIsEqualTo filterFalse = fac.equals(testAttribute, testLiteral);

        // Test OR for false negatives
        Or filter = fac.or(filterFalse, filterTrue);

        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertTrue(filter.evaluate(testFeature));

        // Test OR for false negatives
        filter = fac.or(filterTrue, filterTrue);

        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertTrue(filter.evaluate(testFeature));

        // Test OR for false positives
        filter = fac.or(filterFalse, filterFalse);
        assertFalse(filter.evaluate(testFeature));

        LOGGER.finer( filter.toString());           
        LOGGER.finer( "contains feature: " + filter.evaluate(testFeature));
        assertFalse(filter.evaluate(testFeature));
    }
View Full Code Here

  assertTrue(!logFilter1.equals(logFilter2));
  cFilter1 = ff.equals(testExp1, testExp3);
  logFilter2 = ff.not(cFilter1);
  assertTrue(logFilter1.equals(logFilter2));
        assertTrue(!logFilter1.equals(ff.between(testExp1, testExp2, testExp3)));
  Or logFilter3 = ff.or(logFilter1, logFilter2);
  Or logFilter4 = ff.or(logFilter1, logFilter2);
  assertTrue(logFilter3.equals(logFilter4));

  // Questionable behavior.  Is this what we want?
  Or logFilter5 = ff.or(cFilter1, logFilter3);
  // does not change structure of logFilter3
  Or logFilter6 = ff.or(logFilter4, cFilter1);
  // different structure, but same result
  assertTrue(logFilter5.equals(logFilter6));//do we want these equal?
  assertTrue(logFilter4.equals(logFilter3));//shouldn't they be equal?
    }
View Full Code Here

            PropertyIsEqualTo eq = getFilterFactory().equals(leftHandExpr,
                    expression);
            filterList.add(eq);
        }
        Collections.reverse(filterList);
        Or orFilter = getFilterFactory().or(filterList);

        return orFilter;
    }
View Full Code Here

                // ----------------------------------------
            case JJTIN_PREDICATE_NODE:
                return this.builder.buildInPredicate(JJTEXPRESSION_IN_LIST_NODE);
               
            case JJTNOT_IN_PREDICATE_NODE:
                Or orFilter = this.builder.buildInPredicate(JJTEXPRESSION_IN_LIST_NODE);
                Not notOrFilter = this.builder.buildNotFilter(orFilter);
                   
                return notOrFilter;
        }
View Full Code Here

        return filter;
    }

    private Or buildDuringOrAfter()
            throws CQLException {
        Or filter = null;

        Result node = this.builder.peekResult();

        switch (node.getNodeType()) {
        case JJTPERIOD_BETWEEN_DATES_NODE:
View Full Code Here

    private void commonAssertForInPredicate(Filter filter) throws CQLException {
       
        Assert.assertNotNull(filter);
        Assert.assertTrue(filter instanceof Or);

        Or filterId = (Or) filter;
        List<Filter>  filterList = filterId.getChildren();
        Assert.assertTrue("one or more expressions in Or filter was expected", filterList.size() >= 1);
       
    }
View Full Code Here

                continue;
            }

            if (cloned instanceof Or)
            {
                Or or = (Or) cloned;
                newChildren.addAll(or.getChildren());
            }
            else
            {
                newChildren.add(cloned);
            }
View Full Code Here

        ArrayList<Filter> list = new ArrayList<Filter>();
        if( filter1 == null ){
            // ignore
        }
        else if( filter1 instanceof Or){
            Or some = (Or) filter1;           
            list.addAll( some.getChildren() );
        }
        else {
            list.add( filter1 );
        }
       
        if( filter2 == null){
            // ignore
        }
        else if( filter2 instanceof Or){
            Or more = (Or) filter2;           
            list.addAll( more.getChildren() );
        }
        else {
            list.add( filter2 );
        }
       
View Full Code Here

TOP

Related Classes of org.opengis.filter.Or

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.