本文整理汇总了Java中org.opengis.filter.temporal.After类的典型用法代码示例。如果您正苦于以下问题:Java After类的具体用法?Java After怎么用?Java After使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
After类属于org.opengis.filter.temporal包,在下文中一共展示了After类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterPredicate
import org.opengis.filter.temporal.After; //导入依赖的package包/类
private static void afterPredicate() throws Exception{
// cql_afterPredicate start
After filter = (After) CQL.toFilter("lastEarthQuake AFTER 2006-11-30T01:30:00Z");
// cql_afterPredicate end
Utility.prittyPrintFilter(filter);
final SimpleFeature city = DataExamples.getInstanceOfCity();
Expression leftExpr = filter.getExpression1();
Expression rightExpr = filter.getExpression2();
System.out.println("left expression value: " + leftExpr.evaluate(city));
System.out.println("right expression value: " + rightExpr.evaluate(city));
Boolean result = filter.evaluate(city);
System.out.println("Result of filter evaluation: " + result);
}
示例2: afterPredicateGMT3
import org.opengis.filter.temporal.After; //导入依赖的package包/类
private static void afterPredicateGMT3() throws Exception{
// cql_afterPredicateGMT3 start
After filter = (After) CQL.toFilter("lastEarthQuake AFTER 2006-11-30T01:30:00+03:00");
// cql_afterPredicateGMT3 end
Utility.prittyPrintFilter(filter);
final SimpleFeature city = DataExamples.getInstanceOfCity();
Expression leftExpr = filter.getExpression1();
Expression rightExpr = filter.getExpression2();
System.out.println("left expression value: " + leftExpr.evaluate(city));
System.out.println("right expression value: " + rightExpr.evaluate(city));
Boolean result = filter.evaluate(city);
System.out.println("Result of filter evaluation: " + result);
}
示例3: createFilterCapabilities
import org.opengis.filter.temporal.After; //导入依赖的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;
}
示例4: testTemporalStringLiteral
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testTemporalStringLiteral() {
After filter = ff.after(ff.property("dateAttr"), ff.literal("1970-01-01 00:00:00"));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr", ImmutableMap.of("gt", "1970-01-01 00:00:00")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例5: testNestedTemporalStringLiteral
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testNestedTemporalStringLiteral() {
After filter = ff.after(ff.property("nested.datehej"), ff.literal("1970-01-01 00:00:00"));
Map<String,Object> expectedFilter = ImmutableMap.of("range", ImmutableMap.of("nested.datehej", ImmutableMap.of("gt", "1970-01-01 00:00:00")));
Map<String,Object> expected = ImmutableMap.of("nested", ImmutableMap.of("path", "nested", "query", expectedFilter));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例6: testTemporalInstantLiteralDefaultFormat
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testTemporalInstantLiteralDefaultFormat() throws ParseException {
dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1 = dateFormat.parse("1970-07-19");
Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));
After filter = ff.after(ff.property("dateAttr"), ff.literal(temporalInstant));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr", ImmutableMap.of("gt", "1970-07-19T00:00:00.000Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例7: testTemporalInstanceLiteralExplicitFormat
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testTemporalInstanceLiteralExplicitFormat() throws ParseException {
addDateWithFormatToFeatureType("yyyy-MM-dd");
dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1 = dateFormat.parse("1970-07-19T01:02:03.456-0100");
Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));
After filter = ff.after(ff.property("dateAttrWithFormat"), ff.literal(temporalInstant));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttrWithFormat", ImmutableMap.of("gt", "1970-07-19")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例8: testTemporalInstanceLiteralBasicDateTimeFormat
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testTemporalInstanceLiteralBasicDateTimeFormat() throws ParseException {
addDateWithFormatToFeatureType("basic_date_time");
dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1 = dateFormat.parse("1970-07-19T01:02:03.456-0100");
Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));
After filter = ff.after(ff.property("dateAttrWithFormat"), ff.literal(temporalInstant));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttrWithFormat", ImmutableMap.of("gt", "19700719T020203.456Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例9: testAfterFilter
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testAfterFilter() throws ParseException {
dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1 = dateFormat.parse("1970-07-19T01:02:03.456-0100");
Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));
After filter = ff.after(ff.property("dateAttr"), ff.literal(temporalInstant));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr", ImmutableMap.of("gt", "1970-07-19T02:02:03.456Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例10: testAfterFilterSwapped
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testAfterFilterSwapped() throws ParseException {
dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1 = dateFormat.parse("1970-07-19T01:02:03.456-0100");
Instant temporalInstant = new DefaultInstant(new DefaultPosition(date1));
After filter = ff.after(ff.literal(temporalInstant), ff.property("dateAttr"));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr", ImmutableMap.of("lt", "1970-07-19T02:02:03.456Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例11: testAfterFilterPeriod
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testAfterFilterPeriod() 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);
After filter = ff.after(ff.property("dateAttr"), ff.literal(period));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr", ImmutableMap.of("gt", "1970-07-19T07:08:09.101Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例12: testAfterFilterPeriodSwapped
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Test
public void testAfterFilterPeriodSwapped() 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);
After filter = ff.after(ff.literal(period), ff.property("dateAttr"));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("dateAttr", ImmutableMap.of("lt", "1970-07-19T01:02:03.456Z")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例13: visit
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Override
public Object visit(
final After after,
final Object data ) {
final TemporalConstraints leftResult = btime(after.getExpression1().accept(
this,
data));
final TemporalConstraints rightResult = btime(after.getExpression2().accept(
this,
data));
if (leftResult.isEmpty() || rightResult.isEmpty()) {
return new TemporalConstraints();
}
// property after value
if (leftResult instanceof ParameterTimeConstraint) {
return new ParameterTimeConstraint(
new TemporalRange(
rightResult.getMaxOr(
TemporalRange.START_TIME,
1),
TemporalRange.END_TIME),
leftResult.getName());
}
else if (rightResult instanceof ParameterTimeConstraint) {
return new ParameterTimeConstraint(
new TemporalRange(
TemporalRange.START_TIME,
leftResult.getMinOr(
TemporalRange.END_TIME,
-1)),
rightResult.getName());
}
// property after property
return new TemporalConstraints();
}
示例14: visit
import org.opengis.filter.temporal.After; //导入依赖的package包/类
@Override
public Object visit(
final After after,
final Object extraData ) {
if (!usesProperty(after)) {
return Filter.INCLUDE;
}
return super.visit(
after,
extraData);
}
示例15: visit
import org.opengis.filter.temporal.After; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(After after, Object extraData) {
String propertyName = getPropertyName(after.getExpression1());
String finalName = parsePropertyName(propertyName, after);
Object literal = getLiteralValue(after.getExpression2());
if (literal instanceof Date) {
return Restrictions.gt(finalName, literal);
} else {
throw new UnsupportedOperationException("visit(Object userData)");
}
}