本文整理汇总了Java中org.opengis.filter.Not类的典型用法代码示例。如果您正苦于以下问题:Java Not类的具体用法?Java Not怎么用?Java Not使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Not类属于org.opengis.filter包,在下文中一共展示了Not类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.opengis.filter.Not; //导入依赖的package包/类
/**
* Write the FilterBuilder for a Not filter
*
* @param filter the filter to visit
* @param extraData extra data (unused by this method)
*
*/
public Object visit(Not filter, Object extraData) {
if(filter.getFilter() instanceof PropertyIsNull) {
Expression expr = ((PropertyIsNull) filter.getFilter()).getExpression();
expr.accept(this, extraData);
} else {
filter.getFilter().accept(this, extraData);
}
if(filter.getFilter() instanceof PropertyIsNull) {
queryBuilder = ImmutableMap.of("exists", ImmutableMap.of("field", field));
} else {
queryBuilder = ImmutableMap.of("bool", ImmutableMap.of("must_not", queryBuilder));
}
return extraData;
}
示例2: visit
import org.opengis.filter.Not; //导入依赖的package包/类
@Override
public Object visit(
final Not filter,
final Object data ) {
// no matter what we have to return an infinite envelope
// rationale
// !(finite envelope) -> an unbounded area -> infinite
// !(non spatial filter) -> infinite (no spatial concern)
// !(infinite) -> ... infinite, as the first infinite could be the
// result
// of !(finite envelope)
return new ExtractGeometryFilterVisitorResult(
infinity(),
null);
}
示例3: visit
import org.opengis.filter.Not; //导入依赖的package包/类
@Override
public Object visit(
final Not filter,
final Object data ) {
final Object output = filter.getFilter().accept(
this,
data);
if (output instanceof ParameterTimeConstraint) {
return not((ParameterTimeConstraint) output);
}
else if (output instanceof TemporalConstraintsSet) {
final TemporalConstraintsSet newRangeSet = new TemporalConstraintsSet();
final TemporalConstraintsSet rangeSet = (TemporalConstraintsSet) output;
for (final Map.Entry<String, TemporalConstraints> entry : rangeSet.getSet()) {
newRangeSet.getConstraintsFor(
entry.getKey()).replaceWithMerged(
not(entry.getValue()));
}
return newRangeSet;
}
return output;
}
示例4: testNot
import org.opengis.filter.Not; //导入依赖的package包/类
@Test
public void testNot() {
Not filter = ff.not(ff.id(ff.featureId("id")));
Map<String,Object> expected = ImmutableMap.of("bool", ImmutableMap.of("must_not",
ImmutableMap.of("ids", ImmutableMap.of("values", ImmutableList.of("id")))));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例5: testPropertyIsNotNull
import org.opengis.filter.Not; //导入依赖的package包/类
@Test
public void testPropertyIsNotNull() {
Not filter = ff.not(ff.isNull(ff.property("prop")));
Map<String,Object> expected = ImmutableMap.of("exists", ImmutableMap.of("field", "prop"));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例6: testGetFeaturesWithNOTLogicFilter
import org.opengis.filter.Not; //导入依赖的package包/类
@Test
public void testGetFeaturesWithNOTLogicFilter() throws Exception {
init();
FilterFactory ff = dataStore.getFilterFactory();
PropertyIsEqualTo property1 = ff.equals(ff.property("vendor_s"), ff.literal("D-Link"));
Not filter = ff.not(property1);
SimpleFeatureCollection features = featureSource.getFeatures(filter);
assertEquals(7, features.size());
SimpleFeatureIterator iterator = features.features();
while (iterator.hasNext()) {
SimpleFeature f = iterator.next();
assertTrue(!f.getAttribute("vendor_s").equals("D-Link"));
}
}
示例7: addFilter
import org.opengis.filter.Not; //导入依赖的package包/类
/**
* Adds the filter.
*
* @param node the node
* @return the filter
*/
private Filter addFilter(FilterNode node) {
Filter filter = node.getFilter();
FilterConfigInterface filterConfig = node.getFilterConfig();
if (filter instanceof LogicFilterImpl) {
List<Filter> filterList = new ArrayList<Filter>();
createFilterList(node, filterList);
return filterConfig.createLogicFilter(filterList);
}
List<Expression> parameterFilter = new ArrayList<Expression>();
if (filter instanceof FidFilterImpl) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof BinaryTemporalOperator) {
createExpressionParameterList(node, 2, parameterFilter);
} else if (filter instanceof PropertyIsBetween) {
createExpressionParameterList(node, 3, parameterFilter);
} else if (filter instanceof PropertyIsNull) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof PropertyIsLike) {
createExpressionParameterList(node, 6, parameterFilter);
} else if (filter instanceof BinarySpatialOperator) {
createExpressionParameterList(node, 2, parameterFilter);
} else if (filter instanceof BinaryComparisonAbstract) {
if (filter instanceof Not) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof PropertyIsGreaterThan) {
createExpressionParameterList(node, 2, parameterFilter);
} else {
createExpressionParameterList(node, 3, parameterFilter);
}
} else {
return filter;
}
return filterConfig.createFilter(parameterFilter);
}
示例8: visit
import org.opengis.filter.Not; //导入依赖的package包/类
@Override
public Object visit(Not not, Object o) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例9: visit
import org.opengis.filter.Not; //导入依赖的package包/类
@Override
public Object visit(
final Not filter,
final Object data ) {
return new PropertyConstraintSet();
}
示例10: visit
import org.opengis.filter.Not; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(Not filter, Object userData) {
Criterion c = (Criterion) filter.getFilter().accept(this, userData);
return Restrictions.not(c);
}