org.ofbiz.service.calendar
Class RecurrenceInfo

java.lang.Object
  extended by org.ofbiz.service.calendar.RecurrenceInfo

public class RecurrenceInfo
extends java.lang.Object

Recurrence Info Object


Nested Class Summary
protected static class RecurrenceInfo.RecurrenceWrapper
          Wraps a RecurrenceInfo object with a TemporalExpression object.
 
Field Summary
protected  java.util.List<java.util.Date> eDateList
           
protected  java.util.List<RecurrenceRule> eRulesList
           
protected  GenericValue info
           
static java.lang.String module
           
protected  java.util.List<java.util.Date> rDateList
           
protected  java.util.List<RecurrenceRule> rRulesList
           
protected  java.util.Date startDate
           
 
Constructor Summary
RecurrenceInfo(GenericValue info)
          Creates new RecurrenceInfo
 
Method Summary
 long first()
          Returns the first recurrence.
 long getCurrentCount()
          Returns the current count of this recurrence.
 java.util.Iterator<java.util.Date> getExceptionDateIterator()
          Returns a sorted exception date iterator
 java.util.Iterator<RecurrenceRule> getExceptionRuleIterator()
          Returns a exception recurrence iterator
 java.lang.String getID()
          Returns the primary key for this value object
 java.util.Iterator<java.util.Date> getRecurrenceDateIterator()
          Returns a sorted recurrence date iterator
 java.util.Iterator<RecurrenceRule> getRecurrenceRuleIterator()
          Returns a recurrence rule iterator
 java.util.Date 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(GenericDelegator delegator, long startTime, int frequency, int interval, int count)
           
static RecurrenceInfo makeInfo(GenericDelegator delegator, long startTime, int frequency, int interval, int count, long endTime)
           
static RecurrenceInfo makeInfo(GenericDelegator 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.
 java.lang.String primaryKey()
           
 void remove()
          Removes the recurrence from persistant store.
static TemporalExpression toTemporalExpression(RecurrenceInfo info)
          Convert a RecurrenceInfo object to a TemporalExpression object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

info

protected GenericValue info

startDate

protected java.util.Date startDate

rRulesList

protected java.util.List<RecurrenceRule> rRulesList

eRulesList

protected java.util.List<RecurrenceRule> eRulesList

rDateList

protected java.util.List<java.util.Date> rDateList

eDateList

protected java.util.List<java.util.Date> eDateList
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 java.lang.String getID()
Returns the primary key for this value object


getStartDate

public java.util.Date getStartDate()
Returns the startDate Date object.


getStartTime

public long getStartTime()
Returns the long value of the startDate.


getRecurrenceRuleIterator

public java.util.Iterator<RecurrenceRule> getRecurrenceRuleIterator()
Returns a recurrence rule iterator


getRecurrenceDateIterator

public java.util.Iterator<java.util.Date> getRecurrenceDateIterator()
Returns a sorted recurrence date iterator


getExceptionRuleIterator

public java.util.Iterator<RecurrenceRule> getExceptionRuleIterator()
Returns a exception recurrence iterator


getExceptionDateIterator

public java.util.Iterator<java.util.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 java.lang.String primaryKey()

makeInfo

public static RecurrenceInfo makeInfo(GenericDelegator delegator,
                                      long startTime,
                                      int frequency,
                                      int interval,
                                      int count)
                               throws RecurrenceInfoException
Throws:
RecurrenceInfoException

makeInfo

public static RecurrenceInfo makeInfo(GenericDelegator delegator,
                                      long startTime,
                                      int frequency,
                                      int interval,
                                      long endTime)
                               throws RecurrenceInfoException
Throws:
RecurrenceInfoException

makeInfo

public static RecurrenceInfo makeInfo(GenericDelegator 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