Class TemporalExpressions.Frequency
java.lang.Object
org.apache.ofbiz.service.calendar.TemporalExpression
org.apache.ofbiz.service.calendar.TemporalExpressions.Frequency
- All Implemented Interfaces:
Serializable
,Comparable<TemporalExpression>
- Enclosing class:
- TemporalExpressions
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
TemporalExpression.ExpressionContext
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(TemporalExpressionVisitor visitor) Handles aTemporalExpressionVisitor
visit.boolean
com.ibm.icu.util.Calendar
first
(com.ibm.icu.util.Calendar cal) Returns a date representing the first occurrence of this expression on or after a specified date.int
Returns the frequency count of this expression.int
Returns the frequency type of this expression.Returns the start date of this expression.int
hashCode()
boolean
includesDate
(com.ibm.icu.util.Calendar cal) Returns true if this expression includes the specified date.boolean
isSubstitutionCandidate
(com.ibm.icu.util.Calendar cal, TemporalExpression expressionToTest) Returns true if this expression is a candidate for substitution using the expressionexpressionToTest
for the datecal
.com.ibm.icu.util.Calendar
next
(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context) protected com.ibm.icu.util.Calendar
prepareCal
(com.ibm.icu.util.Calendar cal) Prepare cal calendar.toString()
Methods inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
compareTo, containsExpression, getId, getRange, getSequence, next, setId, setSequence
-
Constructor Details
-
Frequency
- Parameters:
start
- Starting date, defaults to current system timefreqType
- One of the following integer values:Calendar.SECOND Calendar.MINUTE Calendar.HOUR Calendar.DAY_OF_MONTH Calendar.MONTH Calendar.YEAR
freqCount
- A positive integer
-
-
Method Details
-
accept
Description copied from class:TemporalExpression
Handles aTemporalExpressionVisitor
visit.- Specified by:
accept
in classTemporalExpression
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTemporalExpression
-
equals
- Overrides:
equals
in classTemporalExpression
-
first
public com.ibm.icu.util.Calendar first(com.ibm.icu.util.Calendar cal) Description copied from class:TemporalExpression
Returns a date representing the first occurrence of this expression on or after a specified date. Returnsnull
if there is no matching date.- Specified by:
first
in classTemporalExpression
- Parameters:
cal
- A date to evaluate- Returns:
- A Calendar instance representing the first matching date,
or
null
if no matching date is found
-
getFreqCount
public int getFreqCount()Returns the frequency count of this expression.- Returns:
- The frequency count of this expression
-
getFreqType
public int getFreqType()Returns the frequency type of this expression.- Returns:
- The frequency type of this expression
-
getStartDate
Returns the start date of this expression.- Returns:
- The start date of this expression
-
includesDate
public boolean includesDate(com.ibm.icu.util.Calendar cal) Description copied from class:TemporalExpression
Returns true if this expression includes the specified date.- Specified by:
includesDate
in classTemporalExpression
- Parameters:
cal
- A date to evaluate- Returns:
- true if this expression includes the date represented by
cal
-
isSubstitutionCandidate
public boolean isSubstitutionCandidate(com.ibm.icu.util.Calendar cal, TemporalExpression expressionToTest) Description copied from class:TemporalExpression
Returns true if this expression is a candidate for substitution using the expressionexpressionToTest
for the datecal
. ASubstitution
object will call this method when it needs to know if this expression could have produced the datecal
based on the expressionexpressionToTest
.- Specified by:
isSubstitutionCandidate
in classTemporalExpression
- Parameters:
cal
- A date to evaluateexpressionToTest
- An expression to evaluate- Returns:
- true if this expression could have produced the date
cal
using the expressionexpressionToTest
-
next
public com.ibm.icu.util.Calendar next(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context) - Specified by:
next
in classTemporalExpression
-
prepareCal
protected com.ibm.icu.util.Calendar prepareCal(com.ibm.icu.util.Calendar cal) Prepare cal calendar.- Parameters:
cal
- the cal- Returns:
- the calendar
-
toString
- Overrides:
toString
in classTemporalExpression
-