本文整理汇总了Java中org.opengis.filter.temporal.TContains类的典型用法代码示例。如果您正苦于以下问题:Java TContains类的具体用法?Java TContains怎么用?Java TContains使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TContains类属于org.opengis.filter.temporal包,在下文中一共展示了TContains类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testTContains
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
@Test
public void testTContains() throws ParseException {
Date date1 = dateFormat.parse("1970-07-19T01:02:03.456Z");
Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));
Date date2 = dateFormat.parse("1970-07-19T07:08:09.101Z");
Instant temporalInstant2 = new DefaultInstant(new DefaultPosition(date2));
Period period = new DefaultPeriod(temporalInstant, temporalInstant2);
TContains filter = ff.tcontains(ff.literal(period), ff.property("dateAttr"));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr",
ImmutableMap.of("gt", "1970-07-19T01:02:03.456Z", "lt", "1970-07-19T07:08:09.101Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例2: createFilterCapabilities
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
/**
* Sets the capabilities of this filter.
*
* @return FilterCapabilities for this Filter
*/
protected FilterCapabilities createFilterCapabilities() {
FilterCapabilities capabilities = new FilterCapabilities();
capabilities.addAll(FilterCapabilities.LOGICAL_OPENGIS);
capabilities.addAll(FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS);
capabilities.addType(PropertyIsNull.class);
capabilities.addType(PropertyIsBetween.class);
capabilities.addType(Id.class);
capabilities.addType(IncludeFilter.class);
capabilities.addType(ExcludeFilter.class);
capabilities.addType(PropertyIsLike.class);
// spatial filters
capabilities.addType(BBOX.class);
capabilities.addType(Contains.class);
//capabilities.addType(Crosses.class);
capabilities.addType(Disjoint.class);
//capabilities.addType(Equals.class);
capabilities.addType(Intersects.class);
//capabilities.addType(Overlaps.class);
//capabilities.addType(Touches.class);
capabilities.addType(Within.class);
capabilities.addType(DWithin.class);
capabilities.addType(Beyond.class);
//temporal filters
capabilities.addType(After.class);
capabilities.addType(Before.class);
capabilities.addType(Begins.class);
capabilities.addType(BegunBy.class);
capabilities.addType(During.class);
capabilities.addType(Ends.class);
capabilities.addType(EndedBy.class);
capabilities.addType(TContains.class);
capabilities.addType(TEquals.class);
return capabilities;
}
示例3: visit
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
@Override
public Object visit(
final TContains contains,
final Object data ) {
final TemporalConstraints leftResult = (TemporalConstraints) contains.getExpression1().accept(
this,
data);
final TemporalConstraints rightResult = (TemporalConstraints) contains.getExpression2().accept(
this,
data);
if (leftResult.isEmpty() || rightResult.isEmpty()) {
return new TemporalConstraints();
}
// property contains value
if (leftResult instanceof ParameterTimeConstraint) {
return new TemporalConstraints(
new TemporalRange(
TemporalRange.START_TIME,
rightResult.getMaxOr(
TemporalRange.END_TIME,
-1)),
leftResult.getName());
}
else if (rightResult instanceof ParameterTimeConstraint) {
return new ParameterTimeConstraint(
leftResult.getRanges(),
rightResult.getName());
}
// property contains property
return new TemporalConstraints();
}
示例4: visit
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
@Override
public Object visit(
final TContains contains,
final Object extraData ) {
if (!usesProperty(contains)) {
return Filter.INCLUDE;
}
return super.visit(
contains,
extraData);
}
示例5: visit
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
public Object visit(TContains contains, Object extraData) {
return visitBinaryTemporalOperator(contains, extraData);
}
示例6: visit
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
@Override
public Object visit(TContains tc, Object o) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例7: visit
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
@Override
public Object visit(
final TContains contains,
final Object data ) {
return new PropertyConstraintSet();
}
示例8: visit
import org.opengis.filter.temporal.TContains; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(TContains contains, Object extraData) {
throw new UnsupportedOperationException("visit(Object userData)");
}