public class RelativeDateRangePredicateEvaluator extends DateRangePredicateEvaluator
For example:
upperBound=1h
(and no lowerBound) would select anything in the next hour
lowerBound=-1d
(and no upperBound) would select anything in the last 24 hours
lowerBound=-6M
and upperBound=-3M
would select anything 6 months to 3 months old
lowerBound=-1500
and upperBound=5500
would select anything between 1500 milliseconds in the past and
5500 milliseconds in the future
lowerBound=1d
and upperBound=2d
would select anything
in the day after tomorrow
Note it does not take leap years into consideration and all months are 30 days.
Does not support filtering.
Supports facet extraction in the same way as the DateRangePredicateEvaluator
.
EARLIER_THAN_LAST_YEAR, LAST_THREE_MONTHS, LAST_YEAR, THIS_MONTH, THIS_WEEK, THIS_YEAR, TIME_ZONE, TODAY
LOWER_BOUND, LOWER_OPERATION, PROPERTY, PROPERTY_DECIMAL, UPPER_BOUND, UPPER_OPERATION
Constructor and Description |
---|
RelativeDateRangePredicateEvaluator() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getXPathExpression(Predicate p,
EvaluationContext context)
Default implementation that always returns
null , ie. |
long |
parseDateRange(java.lang.String daterange) |
canFilter, canXpath, getFacetExtractor, parseDateString
getOrderByProperties, includes
getOrderByComparator, isFiltering
public java.lang.String getXPathExpression(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
null
, ie. adds
nothing to the XPath query. Subclasses can choose whether they want to
implement this method or use the
AbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext)
method for advanced
filtering (or both).getXPathExpression
in interface PredicateEvaluator
getXPathExpression
in class DateRangePredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationpublic long parseDateRange(java.lang.String daterange) throws java.lang.NumberFormatException
java.lang.NumberFormatException
Copyright © 2010 - 2020 Adobe. All Rights Reserved