com.motorola.iden.udm
Class DateBookRepeatEvent

java.lang.Object
  extended bycom.motorola.iden.udm.DateBookRepeatEvent

public class DateBookRepeatEvent
extends java.lang.Object

Represents a description for a repeating pattern for an Event element. The fields are a subset of the capabilities of the RRULE field in VEVENT defined by the vCalendar 1.0 specification from the Internet Mail Consortium (http://www.imc.org). It is used on an Event to determine how often the Event occurs.

The following table shows the valid values for the fields that can be set in DateBookRepeatEvent:

Field IDs Set Method Valid Values
COUNT setInt any positive int
FREQUENCY setInt DAILY, WEEKLY, MONTHLY, YEARLY
INTERVAL setInt any positive int
END setDate any valid Date
MONTH_IN_YEAR setInt JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER
DAY_IN_WEEK setInt SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
WEEK_IN_MONTH setInt FIRST, SECOND, THIRD, FOURTH, FIFTH, LAST, SECONDLAST, THIRDLAST, FOURTHLAST, FIFTHLAST
DAY_IN_MONTH setInt 1-31
DAY_IN_YEAR setInt 1-366

Examples

The following examples demonstrate some possible repeat values.

To specify the associated event occurs every day:
      setInt(DateBookRepeatEvent.FREQUENCY, DateBookRepeatEvent.DAILY);
To specify the associated event occurs every day for the next five days:
      setInt(DateBookRepeatEvent.FREQUENCY, DateBookRepeatEvent.DAILY);
      setInt(DateBookRepeatEvent.COUNT, 5);
To specify this event occurs every week on Monday and Tuesday:
      setInt(DateBookRepeatEvent.FREQUENCY, DateBookRepeatEvent.WEEKLY);
      setInt(DateBookRepeatEvent.DAY_IN_WEEK, DateBookRepeatEvent.MONDAY | DateBookRepeatEvent.TUESDAY);
To specify the associated event occurs every third week on Friday:
      setInt(DateBookRepeatEvent.FREQUENCY, DateBookRepeatEvent.WEEKLY);
      setInt(DateBookRepeatEvent.INTERVAL, 3);
      setInt(DateBookRepeatEvent.DAY_IN_WEEK, DateBookRepeatEvent.FRIDAY);
To specify the associated event occurs every month on the second Wednesday until the end of the current year:
      setInt(DateBookRepeatEvent.FREQUENCY, DateBookRepeatEvent.MONTHLY);
      setInt(DateBookRepeatEvent.WEEK_IN_MONTH, DateBookRepeatEvent.SECOND);
      setInt(DateBookRepeatEvent.DAY_IN_WEEK, DateBookRepeatEvent.WEDNESDAY);
      java.util.Calendar cal = Calendar.getInstance();
      cal.set(Calendar.MONTH, 11);
      cal.set(Calendar.DAY_OF_MONTH, 31);
      cal.set(Calendar.AM_PM, Calendar.PM);
      cal.set(Calendar.HOUR_OF_DAY, 23);
      cal.set(Calendar.MINUTE, 59);
      setDate(DateBookRepeatEvent.END, cal.getTime().getTime());
To specify the associated event occurs every year on the 4th of July:
      setInt(DateBookRepeatEvent.FREQUENCY, DateBookRepeatEvent.YEARLY);
      setInt(DateBookRepeatEvent.MONTH_IN_YEAR, DateBookRepeatEvent.JULY);
      setInt(DateBookRepeatEvent.DAY_IN_MONTH, 4);

MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2003-2004 Motorola, Inc. All Rights Reserved.


Field Summary
static int APRIL
          APRIL Constant for the month of April.
static int AUGUST
          AUGUST Constant for the month of August.
static int COUNT
          COUNT The number of times this event repeats including the first time, starting from the first time the event starts (derived from Event.START) and continuing to the last date of the repeat (defined by DateBookRepeatEvent.END).
static int DAILY
          DAILY Used for frequency when the Event happens every day.
static int DAY_IN_MONTH
          DAY_IN_MONTH The day of the month an Event occurs; for example, 15.
static int DAY_IN_WEEK
          DAY_IN_WEEK The days of the week an Event occurs.
static int DAY_IN_YEAR
          DAY_IN_YEAR The day of the year an Event occurs; for example, 134.
static int DECEMBER
          DECEMBER Constant for the month of December.
static int END
          END The ending date of the repeating event.
static int FEBRUARY
          FEBRUARY Constant for the month of February.
static int FIFTH
          FIFTH Constant for the fifth week of the month.
static int FIFTHLAST
          FIFTHLAST Constant for the fifth to last week of the month.
static int FIRST
          FIRST Constant for the first week of the month.
static int FOURTH
          FOURTH Constant for the fourth week of the month.
static int FOURTHLAST
          FOURTHLAST Constant for the fourth to last week of the month.
static int FREQUENCY
          FREQUENCY The frequency of the Repeat.
static int FRIDAY
          FRIDAY Constant for the day of week Friday.
static int INTERVAL
          INTERVAL The number of iterations of the frequency between occurring dates, or how often the frequency repeats.
static int JANUARY
          JANUARY Constant for the month of January.
static int JULY
          JULY Constant for the month of July.
static int JUNE
          JUNE Constant for the month of June.
static int LAST
          LAST Constant for the last week of the month.
static int MARCH
          MARCH Constant for the month of March.
static int MAY
          MAY Constant for the month of May.
static int MONDAY
          MONDAY Constant for the day of week Monday.
static int MONTH_IN_YEAR
          MONTH_IN_YEAR The month an event occurs.
static int MONTHLY
          MONTHLY Used for frequency when the Event happens every month.
static int NOVEMBER
          NOVEMBER Constant for the month of November.
static int OCTOBER
          OCTOBER Constant for the month of October.
static int SATURDAY
          SATURDAY Constant for the day of week Saturday.
static int SECOND
          SECOND Constant for the second week of the month.
static int SECONDLAST
          SECONDLAST Constant for the second to last week of the month.
static int SEPTEMBER
          SEPTEMBER Constant for the month of September.
static int SUNDAY
          SUNDAY Constant for the day of week Sunday.
static int THIRD
          THIRD Constant for the third week of the month.
static int THIRDLAST
          THIRDLAST Constant for the third to last week of the month.
static int THURSDAY
          THURSDAY Constant for the day of week Thursday.
static int TUESDAY
          TUESDAY Constant for the day of week Tuesday.
static int WEDNESDAY
          WEDNESDAY Constant for the day of week Wednesday.
static int WEEK_IN_MONTH
          WEEK_IN_MONTH Which week in a month a particular event occurs.
static int WEEKLY
          WEEKLY Used for frequency when the Event happens every week.
static int YEARLY
          YEARLY Used for frequency when the Event happens every year.
 
Constructor Summary
DateBookRepeatEvent()
          DateBookRepeatEvent Constructor
 
Method Summary
 void addExceptDate(long date)
          Add a Date for which this RepeatPattern should not occur.
 long getDate(int fieldID)
          Retrieves a Date field.
 long[] getExceptDates()
          Returns the Dates for which this RepeatPattern should not occur.
 int getInt(int fieldID)
          Retrieves an int field.
 void removeExceptDate(long date)
          Remove a Date for which this RepeatPattern should not occur.
 void setDate(int fieldID, long value)
          Sets a Date field.
 void setInt(int fieldID, int value)
          Sets an int field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COUNT

public static final int COUNT
COUNT The number of times this event repeats including the first time, starting from the first time the event starts (derived from Event.START) and continuing to the last date of the repeat (defined by DateBookRepeatEvent.END).

Value 1 is assigned to COUNT.

See Also:
Constant Field Values

FREQUENCY

public static final int FREQUENCY
FREQUENCY The frequency of the Repeat. This is a value of either DAILY, WEEKLY, MONTHLY or YEARLY.

Value 2 is assigned to FREQUENCY.

See Also:
Constant Field Values

INTERVAL

public static final int INTERVAL
INTERVAL The number of iterations of the frequency between occurring dates, or how often the frequency repeats. On Gemini product, field INTERVAL is only effective when frequency is set to DAILY, WEEKLY, MONTHLY.

Value 3 is assigned to INTERVAL.

See Also:
Constant Field Values

END

public static final int END
END The ending date of the repeating event. On Gemini product, only date parte of field END is effective.

Value 4 is assigned to END.

See Also:
Constant Field Values

MONTH_IN_YEAR

public static final int MONTH_IN_YEAR
MONTH_IN_YEAR The month an event occurs. To set multiple months, OR the values together (e.g. JANUARY | FEBRUARY ).

Value 5 is assigned to MONTH_IN_YEAR.

See Also:
Constant Field Values

WEEK_IN_MONTH

public static final int WEEK_IN_MONTH
WEEK_IN_MONTH Which week in a month a particular event occurs. To set multiple weeks, OR the values together (e.g. FIRST | LAST | SECOND | SECONDLAST).

Value 6 is assigned to WEEK_IN_MONTH.

See Also:
Constant Field Values

DAY_IN_WEEK

public static final int DAY_IN_WEEK
DAY_IN_WEEK The days of the week an Event occurs. To set multiple days, OR the values together (e.g. MONDAY | THURSDAY).

Value 7 is assigned to DAY_IN_WEEK.

See Also:
Constant Field Values

DAY_IN_MONTH

public static final int DAY_IN_MONTH
DAY_IN_MONTH The day of the month an Event occurs; for example, 15.

Value 8 is assigned to DAY_IN_MONTH.

See Also:
Constant Field Values

DAY_IN_YEAR

public static final int DAY_IN_YEAR
DAY_IN_YEAR The day of the year an Event occurs; for example, 134.

Value 9 is assigned to DAY_IN_YEAR.

See Also:
Constant Field Values

DAILY

public static final int DAILY
DAILY Used for frequency when the Event happens every day.

Value 0x10 is assigned to DAILY.

See Also:
Constant Field Values

WEEKLY

public static final int WEEKLY
WEEKLY Used for frequency when the Event happens every week.

Value 0x11 is assigned to WEEKLY.

See Also:
Constant Field Values

MONTHLY

public static final int MONTHLY
MONTHLY Used for frequency when the Event happens every month.

Value 0x12 is assigned to MONTHLY.

See Also:
Constant Field Values

YEARLY

public static final int YEARLY
YEARLY Used for frequency when the Event happens every year.

Value 0x13 is assigned to YEARLY.

See Also:
Constant Field Values

FIRST

public static final int FIRST
FIRST Constant for the first week of the month.

Value 0x1 is assigned to FIRST.

See Also:
Constant Field Values

SECOND

public static final int SECOND
SECOND Constant for the second week of the month.

Value 0x2 is assigned to SECOND.

See Also:
Constant Field Values

THIRD

public static final int THIRD
THIRD Constant for the third week of the month.

Value 0x4 is assigned to THIRD.

See Also:
Constant Field Values

FOURTH

public static final int FOURTH
FOURTH Constant for the fourth week of the month.

Value 0x8 is assigned to FOURTH.

See Also:
Constant Field Values

FIFTH

public static final int FIFTH
FIFTH Constant for the fifth week of the month.

Value 0x10 is assigned to FIFTH.

See Also:
Constant Field Values

LAST

public static final int LAST
LAST Constant for the last week of the month.

Value 0x20 is assigned to LAST.

See Also:
Constant Field Values

SECONDLAST

public static final int SECONDLAST
SECONDLAST Constant for the second to last week of the month.

Value 0x40 is assigned to SECONDLAST.

See Also:
Constant Field Values

THIRDLAST

public static final int THIRDLAST
THIRDLAST Constant for the third to last week of the month.

Value 0x80 is assigned to THIRDLAST.

See Also:
Constant Field Values

FOURTHLAST

public static final int FOURTHLAST
FOURTHLAST Constant for the fourth to last week of the month.

Value 0x100 is assigned to FOURTHLAST.

See Also:
Constant Field Values

FIFTHLAST

public static final int FIFTHLAST
FIFTHLAST Constant for the fifth to last week of the month.

Value 0x200 is assigned to FIFTHLAST.

See Also:
Constant Field Values

SATURDAY

public static final int SATURDAY
SATURDAY Constant for the day of week Saturday.

Value 0x400 is assigned to SATURDAY.

See Also:
Constant Field Values

FRIDAY

public static final int FRIDAY
FRIDAY Constant for the day of week Friday.

Value 0x800 is assigned to FRIDAY.

See Also:
Constant Field Values

THURSDAY

public static final int THURSDAY
THURSDAY Constant for the day of week Thursday.

Value 0x1000 is assigned to THURSDAY.

See Also:
Constant Field Values

WEDNESDAY

public static final int WEDNESDAY
WEDNESDAY Constant for the day of week Wednesday.

Value 0x2000 is assigned to WEDNESDAY.

See Also:
Constant Field Values

TUESDAY

public static final int TUESDAY
TUESDAY Constant for the day of week Tuesday.

Value 0x4000 is assigned to TUESDAY.

See Also:
Constant Field Values

MONDAY

public static final int MONDAY
MONDAY Constant for the day of week Monday.

Value 0x8000 is assigned to MONDAY.

See Also:
Constant Field Values

SUNDAY

public static final int SUNDAY
SUNDAY Constant for the day of week Sunday.

Value 0x10000 is assigned to SUNDAY.

See Also:
Constant Field Values

JANUARY

public static final int JANUARY
JANUARY Constant for the month of January.

Value 0x20000 is assigned to JANUARY.

See Also:
Constant Field Values

FEBRUARY

public static final int FEBRUARY
FEBRUARY Constant for the month of February.

Value 0x40000 is assigned to FEBRUARY.

See Also:
Constant Field Values

MARCH

public static final int MARCH
MARCH Constant for the month of March.

Value 0x80000 is assigned to MARCH.

See Also:
Constant Field Values

APRIL

public static final int APRIL
APRIL Constant for the month of April.

Value 0x100000 is assigned to APRIL.

See Also:
Constant Field Values

MAY

public static final int MAY
MAY Constant for the month of May.

Value 0x200000 is assigned to MAY.

See Also:
Constant Field Values

JUNE

public static final int JUNE
JUNE Constant for the month of June.

Value 0x400000 is assigned to JUNE.

See Also:
Constant Field Values

JULY

public static final int JULY
JULY Constant for the month of July.

Value 0x800000 is assigned to JULY.

See Also:
Constant Field Values

AUGUST

public static final int AUGUST
AUGUST Constant for the month of August.

Value 0x1000000 is assigned to AUGUST.

See Also:
Constant Field Values

SEPTEMBER

public static final int SEPTEMBER
SEPTEMBER Constant for the month of September.

Value 0x2000000 is assigned to SEPTEMBER.

See Also:
Constant Field Values

OCTOBER

public static final int OCTOBER
OCTOBER Constant for the month of October.

Value 0x4000000 is assigned to OCTOBER.

See Also:
Constant Field Values

NOVEMBER

public static final int NOVEMBER
NOVEMBER Constant for the month of November.

Value 0x8000000 is assigned to NOVEMBER.

See Also:
Constant Field Values

DECEMBER

public static final int DECEMBER
DECEMBER Constant for the month of December.

Value 0x10000000 is assigned to DECEMBER.

See Also:
Constant Field Values
Constructor Detail

DateBookRepeatEvent

public DateBookRepeatEvent()
DateBookRepeatEvent Constructor

Method Detail

addExceptDate

public void addExceptDate(long date)
Add a Date for which this RepeatPattern should not occur. Exception date is not supported on Gemini product, this method do nothing.

Parameters:
date - date in long ms format to add to the list of except dates.

removeExceptDate

public void removeExceptDate(long date)
Remove a Date for which this RepeatPattern should not occur. If the date was in the list of except dates, it is removed. Exception date is not supported on Gemini product, this method do nothing.

Parameters:
date - date in long ms format to remove from the list of except dates.

getExceptDates

public long[] getExceptDates()
Returns the Dates for which this RepeatPattern should not occur. Exception date is not supported on Gemini product, this method always return an array with length 0.

Returns:
the Dates in long ms format for which this RepeatPattern should not occur.

getInt

public int getInt(int fieldID)
Retrieves an int field. The fieldID can be one of COUNT, FREQUENCY, MONTH_IN_YEAR, WEEK_IN_MONTH, DAY_IN_WEEK, DAY_IN_MONTH.

Parameters:
fieldID - The field ID to get, for example COUNT.
Returns:
an int representing the value of the field.
Throws:
java.lang.IllegalArgumentException - if fieldID is not one of the valid DateBookRepeatEvent field IDs for this method.

setInt

public void setInt(int fieldID,
                   int value)
Sets an int field. The fieldID can be one of COUNT, FREQUENCY, MONTH_IN_YEAR, WEEK_IN_MONTH, DAY_IN_WEEK, DAY_IN_MONTH.

Parameters:
fieldID - The field ID to set, for example COUNT.
value - The value to set the field to.
Throws:
java.lang.IllegalArgumentException - if fieldID is not one of the valid DateBookRepeatEvent field IDs for this method or if the value is outside the range of supported by the native database.

getDate

public long getDate(int fieldID)
Retrieves a Date field. The field value is currently limited to END.

Parameters:
fieldID - The field ID to get.
Returns:
a Date in long ms format representing the value of the field or 0 to indicate the field has not been set.
Throws:
java.lang.IllegalArgumentException - if fieldID is not one of the valid DateBookRepeatEvent field IDs for this method.

setDate

public void setDate(int fieldID,
                    long value)
Sets a Date field. The field value is currently limited to END.

Parameters:
fieldID - The field ID to set.
value - The value to set the field to.
Throws:
java.lang.IllegalArgumentException - if fieldID is not one of the valid DateBookRepeatEvent field IDs for this method or if the value is outside the range of supported by the native database.