• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java During类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.opengis.filter.temporal.During的典型用法代码示例。如果您正苦于以下问题:Java During类的具体用法?Java During怎么用?Java During使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



During类属于org.opengis.filter.temporal包,在下文中一共展示了During类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testDuring

import org.opengis.filter.temporal.During; //导入依赖的package包/类
@Test
public void testDuring() 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);

    During filter = ff.during(ff.property("dateAttr"), ff.literal(period));
    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());
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:17,代码来源:ElasticFilterTest.java


示例2: duringPredicate

import org.opengis.filter.temporal.During; //导入依赖的package包/类
private static void duringPredicate() throws Exception{
   	
   	// cql_duringPredicate start
       During filter = (During) CQL.toFilter("lastEarthQuake DURING 1700-01-01T00:00:00/2011-01-01T00:00:00");
   	// cql_duringPredicate 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);        
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:17,代码来源:CQLExamples.java


示例3: utcTimeZone

import org.opengis.filter.temporal.During; //导入依赖的package包/类
private static void utcTimeZone() throws Exception{
	
	// utcTimeZone start
    Filter filter = ECQL.toFilter("2006-11-30T01:00:00+03:00 DURING 2006-11-30T00:30:00+03:00/2006-11-30T01:30:00+03:00 ");
	// utcTimeZone end
    Utility.prittyPrintFilter(filter);
    
    Boolean result = filter.evaluate(null);
    System.out.println("Result of filter evaluation: " + result);

    During during = (During) filter;
    Literal literal = (Literal)during.getExpression1();
    Date date = (Date)literal.getValue();
    
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ");
    TimeZone tz = TimeZone.getTimeZone("GMT+0300");
    sdf.setTimeZone(tz);
    System.out.println("Expression 1 as Date: " +sdf.format(date));
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:20,代码来源:ECQLExamples.java


示例4: duringPredicateWithLefHandtAttribute

import org.opengis.filter.temporal.During; //导入依赖的package包/类
private static void duringPredicateWithLefHandtAttribute() throws Exception{
   	
   	// duringPredicateWithLefHandtAttribute start
       During filter = (During) ECQL.toFilter("lastEarthQuake DURING 1700-01-01T00:00:00Z/2011-01-01T00:00:00Z");
   	// duringPredicateWithLefHandtAttribute 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);        
}
 
开发者ID:ianturton,项目名称:geotools-cookbook,代码行数:17,代码来源:ECQLExamples.java


示例5: createFilterCapabilities

import org.opengis.filter.temporal.During; //导入依赖的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;
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:44,代码来源:FilterToElastic.java


示例6: visit

import org.opengis.filter.temporal.During; //导入依赖的package包/类
@Override
public Object visit(
		final During during,
		final Object data ) {
	final TemporalConstraints leftResult = (TemporalConstraints) during.getExpression1().accept(
			this,
			data);

	final TemporalConstraints rightResult = (TemporalConstraints) during.getExpression2().accept(
			this,
			data);

	if (leftResult.isEmpty() || rightResult.isEmpty()) {
		return new TemporalConstraints();
	}

	// property during value
	if (leftResult instanceof ParameterTimeConstraint) {
		return new ParameterTimeConstraint(
				rightResult.getRanges(),
				leftResult.getName());
	}
	// value during property
	else if (rightResult instanceof ParameterTimeConstraint) {
		return rightResult;
	}
	// property during property
	return new TemporalConstraints();
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:30,代码来源:ExtractTimeFilterVisitor.java


示例7: visit

import org.opengis.filter.temporal.During; //导入依赖的package包/类
@Override
public Object visit(
		final During during,
		final Object extraData ) {
	if (!usesProperty(during)) {
		return Filter.INCLUDE;
	}
	return super.visit(
			during,
			extraData);
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:12,代码来源:PropertyIgnoringFilterVisitor.java


示例8: visit

import org.opengis.filter.temporal.During; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(During during, Object userData) {
	String propertyName = getPropertyName(during.getExpression1());
	String finalName = parsePropertyName(propertyName, userData);
	Object literal = getLiteralValue(during.getExpression2());
	if (literal instanceof Period) {
		Period p = (Period) literal;
		Date begin = p.getBeginning().getPosition().getDate();
		Date end = p.getEnding().getPosition().getDate();
		return Restrictions.between(finalName, begin, end);
	} else {
		throw new UnsupportedOperationException("visit(Object userData)");
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:16,代码来源:CriteriaVisitor.java


示例9: testVisitDuring

import org.opengis.filter.temporal.During; //导入依赖的package包/类
@Test
public void testVisitDuring() throws GeomajasException {
	Filter f = filterService.parseFilter("myDate DURING 2006-11-30T00:30:00Z/2006-11-30T01:30:00Z");
	Criterion c = (Criterion) (new CriteriaVisitor((HibernateFeatureModel) layer.getFeatureModel(),
			DateFormat.getDateTimeInstance()).visit((During) f, null));
	Date from = ISODateTimeFormat.dateTimeNoMillis().parseDateTime("2006-11-30T00:30:00Z").toDate();
	Date to = ISODateTimeFormat.dateTimeNoMillis().parseDateTime("2006-11-30T01:30:00Z").toDate();
	Assert.assertEquals("myDate between " + from + " and " + to, c.toString());
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:10,代码来源:CriteriaVisitorTest.java


示例10: visit

import org.opengis.filter.temporal.During; //导入依赖的package包/类
public Object visit(During during, Object extraData) {
    return visitBinaryTemporalOperator(during, extraData);
}
 
开发者ID:ngageoint,项目名称:elasticgeo,代码行数:4,代码来源:FilterToElastic.java


示例11: visit

import org.opengis.filter.temporal.During; //导入依赖的package包/类
@Override
public Object visit(During during, Object o) {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb-simple,代码行数:5,代码来源:FilterToSQL.java


示例12: visit

import org.opengis.filter.temporal.During; //导入依赖的package包/类
@Override
public Object visit(
		final During during,
		final Object data ) {
	return new PropertyConstraintSet();
}
 
开发者ID:locationtech,项目名称:geowave,代码行数:7,代码来源:PropertyFilterVisitor.java


示例13: createFilterCapabilities

import org.opengis.filter.temporal.During; //导入依赖的package包/类
public static FilterCapabilities createFilterCapabilities(boolean encodeFunctions) {
    FilterCapabilities caps = new FilterCapabilities();
    caps.addAll(SQLDialect.BASE_DBMS_CAPABILITIES);

    // adding the spatial filters support
    caps.addType(BBOX.class);
    caps.addType(Contains.class);
    caps.addType(Crosses.class);
    caps.addType(Disjoint.class);
    caps.addType(Equals.class);
    caps.addType(Intersects.class);
    caps.addType(Overlaps.class);
    caps.addType(Touches.class);
    caps.addType(Within.class);
    caps.addType(DWithin.class);
    caps.addType(Beyond.class);
    
    //temporal filters
    caps.addType(After.class);
    caps.addType(Before.class);
    caps.addType(Begins.class);
    caps.addType(BegunBy.class);
    caps.addType(During.class);
    caps.addType(TOverlaps.class);
    caps.addType(Ends.class);
    caps.addType(EndedBy.class);
    caps.addType(TEquals.class);

    if(encodeFunctions) {
        // add support for string functions
        caps.addType(FilterFunction_strConcat.class);
        caps.addType(FilterFunction_strEndsWith.class);
        caps.addType(FilterFunction_strStartsWith.class);
        caps.addType(FilterFunction_strEqualsIgnoreCase.class);
        caps.addType(FilterFunction_strIndexOf.class);
        caps.addType(FilterFunction_strLength.class);
        caps.addType(FilterFunction_strToLowerCase.class);
        caps.addType(FilterFunction_strToUpperCase.class);
        caps.addType(FilterFunction_strReplace.class);
        caps.addType(FilterFunction_strSubstring.class);
        caps.addType(FilterFunction_strSubstringStart.class);
        caps.addType(FilterFunction_strTrim.class);
        caps.addType(FilterFunction_strTrim2.class);
        
        // add support for math functions
        caps.addType(FilterFunction_abs.class);
        caps.addType(FilterFunction_abs_2.class);
        caps.addType(FilterFunction_abs_3.class);
        caps.addType(FilterFunction_abs_4.class);
        caps.addType(FilterFunction_ceil.class);
        caps.addType(FilterFunction_floor.class);
    }

    return caps;
}
 
开发者ID:DennisPallett,项目名称:gt-jdbc-monetdb,代码行数:56,代码来源:FilterToSqlHelper.java



注:本文中的org.opengis.filter.temporal.During类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SupportedFormat类代码示例发布时间:2022-05-23
下一篇:
Java HttpRequestParametersHashModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap