Package org.geotools.stac.store
Class TimeRangeVisitor
- Object
-
- NullFilterVisitor
-
- TimeRangeVisitor
-
- All Implemented Interfaces:
ExpressionVisitor
,FilterVisitor
public class TimeRangeVisitor extends NullFilterVisitor
Returns aDateRange
if the filter is equivalent to a date range on the "datetime" property,null
otherwise, meaning there is more filtering included.
The visitor is not thread safe, callreset
in case you want to re-use and need to check the "exact" property.
-
-
Field Summary
Fields Modifier and Type Field Description static Date
DATE_NEGATIVE_INFINITE
static Date
DATE_POSITIVE_INFINITE
-
Fields inherited from class NullFilterVisitor
NULL_VISITOR
-
-
Constructor Summary
Constructors Constructor Description TimeRangeVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getTimeProperty()
Returns the property name used to match time range expressionsboolean
isExact()
Returns true if the date range exactly represents the filter, false if there are other componentsprotected boolean
isTimeProperty(Expression expression)
Checks if a property is a time property, users can override if they have more sophisticated logic than matching a single property namevoid
reset()
void
setTimeProperty(String timeProperty)
Sets the property name used to match time range expressionsObject
visit(And filter, Object extraData)
Object
visit(ExcludeFilter filter, Object extraData)
VisitFilter.EXCLUDE
(often used during data structure transformations).Object
visit(Id filter, Object extraData)
Object
visit(IncludeFilter filter, Object extraData)
VisitFilter.INCLUDE
(often used during data structure transformations).Object
visit(Not filter, Object extraData)
Object
visit(Or filter, Object extraData)
Object
visit(PropertyIsBetween filter, Object extraData)
Object
visit(PropertyIsEqualTo filter, Object extraData)
Object
visit(PropertyIsGreaterThanOrEqualTo filter, Object extraData)
Object
visit(PropertyIsGreaterThan filter, Object extraData)
Object
visit(PropertyIsLessThanOrEqualTo filter, Object extraData)
Object
visit(PropertyIsLessThan filter, Object extraData)
Object
visit(PropertyIsLike filter, Object extraData)
Object
visit(PropertyIsNil filter, Object extraData)
Object
visit(PropertyIsNotEqualTo filter, Object extraData)
Object
visit(PropertyIsNull filter, Object extraData)
Object
visit(BBOX filter, Object extraData)
Object
visit(Beyond filter, Object extraData)
Object
visit(Contains filter, Object extraData)
Object
visit(Crosses filter, Object extraData)
Object
visit(Disjoint filter, Object extraData)
Object
visit(DWithin filter, Object extraData)
Object
visit(Equals filter, Object extraData)
Object
visit(Intersects filter, Object extraData)
Object
visit(Overlaps filter, Object extraData)
Object
visit(Touches filter, Object extraData)
Object
visit(Within filter, Object extraData)
Object
visit(After filter, Object extraData)
Object
visit(AnyInteracts anyInteracts, Object extraData)
Object
visit(Before filter, Object extraData)
Object
visit(Begins begins, Object extraData)
Object
visit(BegunBy begunBy, Object extraData)
Object
visit(During during, Object extraData)
Object
visit(EndedBy endedBy, Object extraData)
Object
visit(Ends ends, Object extraData)
Object
visit(Meets meets, Object extraData)
Object
visit(MetBy metBy, Object extraData)
Object
visit(OverlappedBy overlappedBy, Object extraData)
Object
visit(TContains contains, Object extraData)
Object
visit(TEquals filter, Object extraData)
Object
visit(TOverlaps contains, Object extraData)
Object
visitNullFilter(Object extraData)
Used to account for anull
filter value.
-
-
-
Method Detail
-
getTimeProperty
public String getTimeProperty()
Returns the property name used to match time range expressions
-
setTimeProperty
public void setTimeProperty(String timeProperty)
Sets the property name used to match time range expressions
-
isExact
public boolean isExact()
Returns true if the date range exactly represents the filter, false if there are other components- Returns:
-
reset
public void reset()
-
isTimeProperty
protected boolean isTimeProperty(Expression expression)
Checks if a property is a time property, users can override if they have more sophisticated logic than matching a single property name- Parameters:
expression
-- Returns:
-
visitNullFilter
public Object visitNullFilter(Object extraData)
Description copied from interface:FilterVisitor
Used to account for anull
filter value.This is particularly used during data structure transofrmations, however the use of
null
is not recommended. Please make use of Filter.NONE and Filter.ALL as placeholder objects that communicate intent.- Specified by:
visitNullFilter
in interfaceFilterVisitor
- Overrides:
visitNullFilter
in classNullFilterVisitor
- Parameters:
extraData
- Value object provided to visitor- Returns:
- subclass defined
-
visit
public Object visit(ExcludeFilter filter, Object extraData)
Description copied from interface:FilterVisitor
VisitFilter.EXCLUDE
(often used during data structure transformations).- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
- Parameters:
filter
-Filter.EXCLUDE
.extraData
- Value object provided to visitor- Returns:
- subclass supplied
-
visit
public Object visit(IncludeFilter filter, Object extraData)
Description copied from interface:FilterVisitor
VisitFilter.INCLUDE
(often used during data structure transformations).- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
- Parameters:
filter
-Filter.INCLUDE
.extraData
- Value object provided to visitor- Returns:
- subclass supplied
-
visit
public Object visit(And filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Id filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Not filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Or filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsBetween filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsNotEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsGreaterThan filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsGreaterThanOrEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsLessThan filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsLessThanOrEqualTo filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsLike filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsNull filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(PropertyIsNil filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(BBOX filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Beyond filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Contains filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Crosses filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Disjoint filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(DWithin filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Equals filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Intersects filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Overlaps filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Touches filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Within filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(After filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(AnyInteracts anyInteracts, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Before filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Begins begins, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(BegunBy begunBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(During during, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(EndedBy endedBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Ends ends, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(Meets meets, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(MetBy metBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(OverlappedBy overlappedBy, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(TContains contains, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(TEquals filter, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
visit
public Object visit(TOverlaps contains, Object extraData)
- Specified by:
visit
in interfaceFilterVisitor
- Overrides:
visit
in classNullFilterVisitor
-
-