@Test public void testAndTemporalMetBy() throws Exception { final Period p = period("2016-01-01T00:00:00.000-0500", "2106-01-02T00:00:00.000-0500"); final Filter f = ff.and( ff.bbox("geom", -10, -10, 10, 10, null), ff.metBy(ff.literal("someDate"), ff.literal(p))); final Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); }
private ReferencedEnvelope bbox(Object data) { if (data == null) { return null; } else if (data instanceof ReferencedEnvelope) { return (ReferencedEnvelope) data; } else if (data instanceof Envelope) { return new ReferencedEnvelope((Envelope) data, null); } else if (data instanceof CoordinateReferenceSystem) { return new ReferencedEnvelope((CoordinateReferenceSystem) data); } throw new ClassCastException("Could not cast data to ReferencedEnvelope"); }
ExtractBoundsFilterVisitor extends NullFilterVisitor { private ReferencedEnvelope bbox(Object data) { if (data == null) { return null; } else if (data instanceof ReferencedEnvelope) { return (ReferencedEnvelope) data; } else if (data instanceof Envelope) { return new ReferencedEnvelope((Envelope) data, null); } else if (data instanceof CoordinateReferenceSystem) { return new ReferencedEnvelope((CoordinateReferenceSystem) data); } throw new ClassCastException("Could not cast data to ReferencedEnvelope"); } }
ExtractBoundsFilterVisitor extends NullFilterVisitor { private ReferencedEnvelope bbox(Object data) { if (data == null) { return null; } else if (data instanceof ReferencedEnvelope) { return (ReferencedEnvelope) data; } else if (data instanceof Envelope) { return new ReferencedEnvelope((Envelope) data, null); } else if (data instanceof CoordinateReferenceSystem) { return new ReferencedEnvelope((CoordinateReferenceSystem) data); } throw new ClassCastException("Could not cast data to ReferencedEnvelope"); } protected  ExtractBoundsFilterVisitor(); }
ExtractBoundsFilterVisitor extends NullFilterVisitor { private ReferencedEnvelope bbox(Object data) { if (data == null) { return null; } else if (data instanceof ReferencedEnvelope) { return (ReferencedEnvelope) data; } else if (data instanceof Envelope) { return new ReferencedEnvelope((Envelope) data, null); } else if (data instanceof CoordinateReferenceSystem) { return new ReferencedEnvelope((CoordinateReferenceSystem) data); } throw new ClassCastException("Could not cast data to ReferencedEnvelope"); } protected  ExtractBoundsFilterVisitor(); Object visit(ExcludeFilter filter, Object data); Object visit(IncludeFilter filter, Object data); Object visit(BBOX filter, Object data); Object visit(Literal expression, Object data); @Override Object visit(And filter, Object data); Object visit(Not filter, Object data); @Override Object visit(Or filter, Object data); Object visit(Beyond filter, Object data); Object visit(Contains filter, Object data); Object visit(Crosses filter, Object data); Object visit(Disjoint filter, Object data); Object visit(DWithin filter, Object data); Object visit(Equals filter, Object data); Object visit(Intersects filter, Object data); Object visit(Overlaps filter, Object data); Object visit(Touches filter, Object data); Object visit(Within filter, Object data); @Override Object visit(Add expression, Object data); @Override Object visit(Divide expression, Object data); @Override Object visit(Function expression, Object data); @Override Object visit(Id filter, Object data); @Override Object visit(Multiply expression, Object data); @Override Object visit(NilExpression expression, Object data); @Override Object visit(PropertyIsBetween filter, Object data); @Override Object visit(PropertyIsEqualTo filter, Object data); @Override Object visit(PropertyIsGreaterThan filter, Object data); @Override Object visit(PropertyIsGreaterThanOrEqualTo filter, Object data); @Override Object visit(PropertyIsLessThan filter, Object data); @Override Object visit(PropertyIsLessThanOrEqualTo filter, Object data); @Override Object visit(PropertyIsLike filter, Object data); @Override Object visit(PropertyIsNotEqualTo filter, Object data); @Override Object visit(PropertyIsNull filter, Object data); @Override Object visit(PropertyName expression, Object data); @Override Object visit(Subtract expression, Object data); @Override Object visitNullFilter(Object data); @Override Object visit(After after, Object data); @Override Object visit(AnyInteracts anyInteracts, Object data); @Override Object visit(Before before, Object data); @Override Object visit(Begins begins, Object data); @Override Object visit(BegunBy begunBy, Object data); @Override Object visit(During filter, Object data); @Override Object visit(EndedBy endedBy, Object data); @Override Object visit(Ends ends, Object data); @Override Object visit(Meets meets, Object data); @Override Object visit(MetBy metBy, Object data); @Override Object visit(OverlappedBy overlappedBy, Object data); @Override Object visit(TContains contains, Object data); @Override Object visit(TEquals equals, Object data); @Override Object visit(TOverlaps contains, Object data); @Override Object visit(PropertyIsNil filter, Object data); }
ExtractBoundsFilterVisitor extends NullFilterVisitor { private ReferencedEnvelope bbox(Object data) { if (data == null) { return null; } else if (data instanceof ReferencedEnvelope) { return (ReferencedEnvelope) data; } else if (data instanceof Envelope) { return new ReferencedEnvelope((Envelope) data, null); } else if (data instanceof CoordinateReferenceSystem) { return new ReferencedEnvelope((CoordinateReferenceSystem) data); } throw new ClassCastException("Could not cast data to ReferencedEnvelope"); } protected  ExtractBoundsFilterVisitor(); Object visit(ExcludeFilter filter, Object data); Object visit(IncludeFilter filter, Object data); Object visit(BBOX filter, Object data); Object visit(Literal expression, Object data); @Override Object visit(And filter, Object data); Object visit(Not filter, Object data); @Override Object visit(Or filter, Object data); Object visit(Beyond filter, Object data); Object visit(Contains filter, Object data); Object visit(Crosses filter, Object data); Object visit(Disjoint filter, Object data); Object visit(DWithin filter, Object data); Object visit(Equals filter, Object data); Object visit(Intersects filter, Object data); Object visit(Overlaps filter, Object data); Object visit(Touches filter, Object data); Object visit(Within filter, Object data); @Override Object visit(Add expression, Object data); @Override Object visit(Divide expression, Object data); @Override Object visit(Function expression, Object data); @Override Object visit(Id filter, Object data); @Override Object visit(Multiply expression, Object data); @Override Object visit(NilExpression expression, Object data); @Override Object visit(PropertyIsBetween filter, Object data); @Override Object visit(PropertyIsEqualTo filter, Object data); @Override Object visit(PropertyIsGreaterThan filter, Object data); @Override Object visit(PropertyIsGreaterThanOrEqualTo filter, Object data); @Override Object visit(PropertyIsLessThan filter, Object data); @Override Object visit(PropertyIsLessThanOrEqualTo filter, Object data); @Override Object visit(PropertyIsLike filter, Object data); @Override Object visit(PropertyIsNotEqualTo filter, Object data); @Override Object visit(PropertyIsNull filter, Object data); @Override Object visit(PropertyName expression, Object data); @Override Object visit(Subtract expression, Object data); @Override Object visitNullFilter(Object data); @Override Object visit(After after, Object data); @Override Object visit(AnyInteracts anyInteracts, Object data); @Override Object visit(Before before, Object data); @Override Object visit(Begins begins, Object data); @Override Object visit(BegunBy begunBy, Object data); @Override Object visit(During filter, Object data); @Override Object visit(EndedBy endedBy, Object data); @Override Object visit(Ends ends, Object data); @Override Object visit(Meets meets, Object data); @Override Object visit(MetBy metBy, Object data); @Override Object visit(OverlappedBy overlappedBy, Object data); @Override Object visit(TContains contains, Object data); @Override Object visit(TEquals equals, Object data); @Override Object visit(TOverlaps contains, Object data); @Override Object visit(PropertyIsNil filter, Object data); static NullFilterVisitor BOUNDS_VISITOR; }