Class RecurrenceInfo
- java.lang.Object
-
- org.apache.ofbiz.service.calendar.RecurrenceInfo
-
public class RecurrenceInfo extends Object
Recurrence Info Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
RecurrenceInfo.RecurrenceWrapper
Wraps a RecurrenceInfo object with a TemporalExpression object.
-
Field Summary
Fields Modifier and Type Field Description protected List<Date>
eDateList
protected List<RecurrenceRule>
eRulesList
protected GenericValue
info
static String
module
protected List<Date>
rDateList
protected List<RecurrenceRule>
rRulesList
protected Date
startDate
-
Constructor Summary
Constructors Constructor Description RecurrenceInfo(GenericValue info)
Creates new RecurrenceInfo
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
first()
Returns the first recurrence.long
getCurrentCount()
Returns the current count of this recurrence.Iterator<Date>
getExceptionDateIterator()
Returns a sorted exception date iteratorIterator<RecurrenceRule>
getExceptionRuleIterator()
Returns a exception recurrence iteratorString
getID()
Returns the primary key for this value objectIterator<Date>
getRecurrenceDateIterator()
Returns a sorted recurrence date iteratorIterator<RecurrenceRule>
getRecurrenceRuleIterator()
Returns a recurrence rule iteratorDate
getStartDate()
Returns the startDate Date object.long
getStartTime()
Returns the long value of the startDate.void
incrementCurrentCount()
Increments the current count of this recurrence and updates the record.void
incrementCurrentCount(boolean store)
Increments the current count of this recurrence.void
init()
Initializes the rules for this RecurrenceInfo object.boolean
isValidCurrent()
Checks the current recurrence validity at the moment.boolean
isValidCurrent(long checkTime)
Checks the current recurrence validity for checkTime.long
last()
Returns the estimated last recurrence.static RecurrenceInfo
makeInfo(Delegator delegator, long startTime, int frequency, int interval, int count)
static RecurrenceInfo
makeInfo(Delegator delegator, long startTime, int frequency, int interval, int count, long endTime)
static RecurrenceInfo
makeInfo(Delegator delegator, long startTime, int frequency, int interval, long endTime)
long
next()
Returns the next recurrence from now.long
next(long fromTime)
Returns the next recurrence from the specified time.String
primaryKey()
void
remove()
Removes the recurrence from persistant store.static TemporalExpression
toTemporalExpression(RecurrenceInfo info)
Convert a RecurrenceInfo object to a TemporalExpression object.
-
-
-
Field Detail
-
module
public static final String module
-
info
protected GenericValue info
-
startDate
protected Date startDate
-
rRulesList
protected List<RecurrenceRule> rRulesList
-
eRulesList
protected List<RecurrenceRule> eRulesList
-
-
Constructor Detail
-
RecurrenceInfo
public RecurrenceInfo(GenericValue info) throws RecurrenceInfoException
Creates new RecurrenceInfo- Throws:
RecurrenceInfoException
-
-
Method Detail
-
init
public void init() throws RecurrenceInfoException
Initializes the rules for this RecurrenceInfo object.- Throws:
RecurrenceInfoException
-
getID
public String getID()
Returns the primary key for this value object
-
getStartDate
public Date getStartDate()
Returns the startDate Date object.
-
getStartTime
public long getStartTime()
Returns the long value of the startDate.
-
getRecurrenceRuleIterator
public Iterator<RecurrenceRule> getRecurrenceRuleIterator()
Returns a recurrence rule iterator
-
getRecurrenceDateIterator
public Iterator<Date> getRecurrenceDateIterator()
Returns a sorted recurrence date iterator
-
getExceptionRuleIterator
public Iterator<RecurrenceRule> getExceptionRuleIterator()
Returns a exception recurrence iterator
-
getExceptionDateIterator
public Iterator<Date> getExceptionDateIterator()
Returns a sorted exception date iterator
-
getCurrentCount
public long getCurrentCount()
Returns the current count of this recurrence.
-
incrementCurrentCount
public void incrementCurrentCount() throws GenericEntityException
Increments the current count of this recurrence and updates the record.- Throws:
GenericEntityException
-
incrementCurrentCount
public void incrementCurrentCount(boolean store) throws GenericEntityException
Increments the current count of this recurrence.- Throws:
GenericEntityException
-
remove
public void remove() throws RecurrenceInfoException
Removes the recurrence from persistant store.- Throws:
RecurrenceInfoException
-
first
public long first()
Returns the first recurrence.
-
last
public long last()
Returns the estimated last recurrence.
-
next
public long next()
Returns the next recurrence from now.
-
next
public long next(long fromTime)
Returns the next recurrence from the specified time.
-
isValidCurrent
public boolean isValidCurrent()
Checks the current recurrence validity at the moment.
-
isValidCurrent
public boolean isValidCurrent(long checkTime)
Checks the current recurrence validity for checkTime.
-
primaryKey
public String primaryKey()
-
makeInfo
public static RecurrenceInfo makeInfo(Delegator delegator, long startTime, int frequency, int interval, int count) throws RecurrenceInfoException
- Throws:
RecurrenceInfoException
-
makeInfo
public static RecurrenceInfo makeInfo(Delegator delegator, long startTime, int frequency, int interval, long endTime) throws RecurrenceInfoException
- Throws:
RecurrenceInfoException
-
makeInfo
public static RecurrenceInfo makeInfo(Delegator delegator, long startTime, int frequency, int interval, int count, long endTime) throws RecurrenceInfoException
- Throws:
RecurrenceInfoException
-
toTemporalExpression
public static TemporalExpression toTemporalExpression(RecurrenceInfo info)
Convert a RecurrenceInfo object to a TemporalExpression object.- Parameters:
info
- A RecurrenceInfo instance- Returns:
- A TemporalExpression instance
-
-