Class RecurrenceInfo.RecurrenceWrapper
- java.lang.Object
-
- org.apache.ofbiz.service.calendar.TemporalExpression
-
- org.apache.ofbiz.service.calendar.RecurrenceInfo.RecurrenceWrapper
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TemporalExpression>
- Enclosing class:
- RecurrenceInfo
protected static class RecurrenceInfo.RecurrenceWrapper extends TemporalExpression
Wraps a RecurrenceInfo object with a TemporalExpression object. This class is intended to help with the transition from RecurrenceInfo/RecurrenceRule to TemporalExpression.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
TemporalExpression.ExpressionContext
-
-
Field Summary
Fields Modifier and Type Field Description protected RecurrenceInfo
info
-
Fields inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
id, sequence
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RecurrenceWrapper()
RecurrenceWrapper(RecurrenceInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(TemporalExpressionVisitor visitor)
Handles aTemporalExpressionVisitor
visit.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.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)
-
Methods inherited from class org.apache.ofbiz.service.calendar.TemporalExpression
compareTo, containsExpression, equals, getId, getRange, hashCode, next, setId, toString
-
-
-
-
Field Detail
-
info
protected RecurrenceInfo info
-
-
Constructor Detail
-
RecurrenceWrapper
protected RecurrenceWrapper()
-
RecurrenceWrapper
public RecurrenceWrapper(RecurrenceInfo info)
-
-
Method Detail
-
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
-
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
-
next
public com.ibm.icu.util.Calendar next(com.ibm.icu.util.Calendar cal, TemporalExpression.ExpressionContext context)
- Specified by:
next
in classTemporalExpression
-
accept
public void accept(TemporalExpressionVisitor visitor)
Description copied from class:TemporalExpression
Handles aTemporalExpressionVisitor
visit.- Specified by:
accept
in classTemporalExpression
-
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
-
-