@Test public void testTwoRanges() throws ParseException { DateRangeVisitor visitor = new DateRangeVisitor("start", "end"); visitor.visit(buildRangeFeature("2008-10-31T00:00:00.000Z", "2008-11-01T00:00:00.000Z")); visitor.visit(buildRangeFeature("2008-11-05T00:00:00.000Z", "2008-11-07T00:00:00.000Z")); List<String> range = new ArrayList<String>(visitor.getRange()); assertEquals(2, range.size()); assertEquals("2008-10-31T00:00:00.000Z/2008-11-01T00:00:00.000Z/PT1S", range.get(0)); assertEquals("2008-11-05T00:00:00.000Z/2008-11-07T00:00:00.000Z/PT1S", range.get(1)); }
public void visit(Feature feature) { final Object firstValue = expr1.evaluate(feature); final Object secondValue = expr2.evaluate(feature); if (firstValue != null && secondValue != null) { final Date beginDate = (Date) firstValue; final Date endDate = (Date) secondValue; set.add(new DateRange(beginDate, endDate)); } }
DateRangeVisitor extends RangeVisitor { public void visit(Feature feature) { final Object firstValue = expr1.evaluate(feature); final Object secondValue = expr2.evaluate(feature); if (firstValue != null && secondValue != null) { final Date beginDate = (Date) firstValue; final Date endDate = (Date) secondValue; set.add(new DateRange(beginDate, endDate)); } } }
DateRangeVisitor extends RangeVisitor { public void visit(Feature feature) { final Object firstValue = expr1.evaluate(feature); final Object secondValue = expr2.evaluate(feature); if (firstValue != null && secondValue != null) { final Date beginDate = (Date) firstValue; final Date endDate = (Date) secondValue; set.add(new DateRange(beginDate, endDate)); } } DateRangeVisitor(String attributeTypeName1, String attributeTypeName2); }
DateRangeVisitor extends RangeVisitor { public void visit(Feature feature) { final Object firstValue = expr1.evaluate(feature); final Object secondValue = expr2.evaluate(feature); if (firstValue != null && secondValue != null) { final Date beginDate = (Date) firstValue; final Date endDate = (Date) secondValue; set.add(new DateRange(beginDate, endDate)); } } DateRangeVisitor(String attributeTypeName1, String attributeTypeName2); void visit(Feature feature); }
DateRangeVisitor extends RangeVisitor { public void visit(Feature feature) { final Object firstValue = expr1.evaluate(feature); final Object secondValue = expr2.evaluate(feature); if (firstValue != null && secondValue != null) { final Date beginDate = (Date) firstValue; final Date endDate = (Date) secondValue; set.add(new DateRange(beginDate, endDate)); } } DateRangeVisitor(String attributeTypeName1, String attributeTypeName2); void visit(Feature feature);  }