net.rim.blackberry.api.pim
Class RepeatRule

java.lang.Object
  |
  +--net.rim.blackberry.api.pim.RepeatRule

Deprecated. In favour of RepeatRule.

public class RepeatRule
extends Object

Contains the repeating rule functionality for event items. The RepeatRule class defines when and how often an event is repeated, for example, yearly, monthly or daily.

You can use the RepeatRule object to create a recurring event by allowing you to specify a recurrence pattern for the event. The RepeatRule allows you to specify the frequency, interval and number of recurrences for each event.

Below, a RepeatRule is created and associated with a new event. The event will repeat on the 28th day of every month.

         RepeatRule recurring = new RepeatRule();
         recurring.setInt(RepeatRule.FREQUENCY, RepeatRule.MONTHLY); 
         recurring.setInt(RepeatRule.DAY_IN_MONTH, 28); 
 
         events = EventList.open(EventList.READ_WRITE);
         Event event = events.createEvent();
         event.setRepeat(recurring);
 
For more information about this class or about the personal information management (PIM) API, refer to The PDA Profile specification (JSR-000075) for the J2ME(TM) Platform.

Since:
PDAP 1.0
See Also:
Event, EventList

Field Summary
static int APRIL
          Deprecated. Represents the constant for the month: April.
static int AUGUST
          Deprecated. Represents the constant for the month: August.
static int COUNT
          Deprecated. Represents the number of times the event will occur.
static int DAILY
          Deprecated. Indicates that the frequency of the event occurs daily.
static int DAY_IN_MONTH
          Deprecated. Represents the day in the month that this event will occur.
static int DAY_IN_WEEK
          Deprecated. Represents the day in the week that this event will occur.
static int DAY_IN_YEAR
          Deprecated. Represents the day in the year that this event will occur.
static int DECEMBER
          Deprecated. Represents the constant for the month: December.
static int END
          Deprecated. Represents the end date of an event.
static int FEBRUARY
          Deprecated. Represents the constant for the month: February.
static int FIFTH
          Deprecated. Represents the fifth week of the month.
static int FIFTHLAST
          Deprecated. Represents the fifth last week of the month.
static int FIRST
          Deprecated. Represents the first week of the month.
static int FOURTH
          Deprecated. Represents the fourth week of the month.
static int FOURTHLAST
          Deprecated. Represents the fourth last week of the month.
static int FREQUENCY
          Deprecated. Represents the frequency of the event.
static int FRIDAY
          Deprecated. Represents the constant for the day: Friday.
static int INTERVAL
          Deprecated. The interval represents the amount of time between events, or the number of times the frequency repeats between events.
static int JANUARY
          Deprecated. Represents the constant for the month: January.
static int JULY
          Deprecated. Represents the constant for the month: July.
static int JUNE
          Deprecated. Represents the constant for the month: June.
static int LAST
          Deprecated. Represents the last week of the month.
static int MARCH
          Deprecated. Represents the constant for the month: March.
static int MAY
          Deprecated. Represents the constant for the month: May.
static int MONDAY
          Deprecated. Represents the constant for the day: Monday.
static int MONTH_IN_YEAR
          Deprecated. Represents the month in the year that this event will occur.
static int MONTHLY
          Deprecated. Indicates that the frequency of the event occurs monthly.
static int NOVEMBER
          Deprecated. Represents the constant for the month: November.
static int OCTOBER
          Deprecated. Represents the constant for the month: October.
static int SATURDAY
          Deprecated. Represents the constant for the day: Saturday.
static int SECOND
          Deprecated. Represents the second week of the month.
static int SECONDLAST
          Deprecated. Represents the second last week of the month.
static int SEPTEMBER
          Deprecated. Represents the constant for the month: September.
static int SUNDAY
          Deprecated. Represents the constant for the day: Sunday.
static int THIRD
          Deprecated. Represents the third week of the month.
static int THIRDLAST
          Deprecated. Represents the third last week of the month.
static int THURSDAY
          Deprecated. Represents the constant for the day: Thursday.
static int TUESDAY
          Deprecated. Represents the constant for the day: Tuesday.
static int WEDNESDAY
          Deprecated. Represents the constant for the day: Wednesday.
static int WEEK_IN_MONTH
          Deprecated. Represents the week in the month that this event will occur.
static int WEEKLY
          Deprecated. Indicates that the frequency of the event occurs weekly.
static int YEARLY
          Deprecated. Indicates that the frequency of the event occurs yearly.
 
Constructor Summary
RepeatRule()
          Deprecated. Creates a new RepeatRule instance.
 
Method Summary
 void addExceptDate(long date)
          Deprecated. Adds a date for which the event will not occur.
 Enumeration dates(long startDate, long subsetBeginning, long subsetEnding)
          Deprecated. Returns an enumeration of event dates, ordered by date, between the specified subsetBeginning and subsetEnding parameters.
 boolean equals(Object obj)
          Deprecated. Indicates whether some other object is "equal to" this one.
 long getDate(int field)
          Deprecated. Returns the date of the specified field.
 long[] getExceptDates()
          Deprecated. Returns an array containing the dates on which the RepeatRule will not occur.
 int[] getFields()
          Deprecated. Returns an array of integers representing the fields in the RepeatRule.
 int getInt(int field)
          Deprecated. Returns an integer representing a RepeatRule field value.
 void removeExceptDate(long date)
          Deprecated. Removes an excepted date from the RepeatRule.
 void setDate(int field, long value)
          Deprecated. Sets a date for the specified field.
 void setInt(int field, int value)
          Deprecated. Sets an integer that specifies a RepeatRule field and value.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COUNT

public static final int COUNT
Deprecated. 
Represents the number of times the event will occur.

This value is determined using Event.START and RepeatRule.END

Since:
JDE 3.6.0

DAY_IN_MONTH

public static final int DAY_IN_MONTH
Deprecated. 
Represents the day in the month that this event will occur.

This index is 1-based. In other words, the value 15 represents the 15th day of the month.

Since:
JDE 3.6.0

DAY_IN_WEEK

public static final int DAY_IN_WEEK
Deprecated. 
Represents the day in the week that this event will occur.

This index is 1-based. In other words, the value 2 represents the 2nd day of the week. Values can be OR'd together to indicate a multple day event.

Since:
JDE 3.6.0

DAY_IN_YEAR

public static final int DAY_IN_YEAR
Deprecated. 
Represents the day in the year that this event will occur.

This index is 1-based. In other words, the value 200 represents the 200th day of the month.

Since:
JDE 3.6.0

END

public static final int END
Deprecated. 
Represents the end date of an event.

Since:
JDE 3.6.0

FREQUENCY

public static final int FREQUENCY
Deprecated. 
Represents the frequency of the event.

This value can be YEARLY, MONTHLY, WEEKLY, DAILY.

Since:
JDE 3.6.0

INTERVAL

public static final int INTERVAL
Deprecated. 
The interval represents the amount of time between events, or the number of times the frequency repeats between events. For example, to schedule an event to occur every other day, the FREQUENCY is DAILY and the INTERVAL is 2, thus every 2nd DAILY occurence is considered an occurence of the event.

Since:
JDE 3.6.0

MONTH_IN_YEAR

public static final int MONTH_IN_YEAR
Deprecated. 
Represents the month in the year that this event will occur.

This index is 1-based. In other words, the value 6 represents the 6th month of the year. Values can be OR'd together to set multple months.

Since:
JDE 3.6.0

WEEK_IN_MONTH

public static final int WEEK_IN_MONTH
Deprecated. 
Represents the week in the month that this event will occur.

This index is 1-based. In other words, the value 2 represents the 2nd week of the month. Values can be OR'd together to set multple weeks.

Since:
JDE 3.6.0

DAILY

public static final int DAILY
Deprecated. 
Indicates that the frequency of the event occurs daily.

Since:
JDE 3.6.0

WEEKLY

public static final int WEEKLY
Deprecated. 
Indicates that the frequency of the event occurs weekly.

Since:
JDE 3.6.0

MONTHLY

public static final int MONTHLY
Deprecated. 
Indicates that the frequency of the event occurs monthly.

Since:
JDE 3.6.0

YEARLY

public static final int YEARLY
Deprecated. 
Indicates that the frequency of the event occurs yearly.

Since:
JDE 3.6.0

FIRST

public static final int FIRST
Deprecated. 
Represents the first week of the month.
Since:
JDE 3.6.0

SECOND

public static final int SECOND
Deprecated. 
Represents the second week of the month.
Since:
JDE 3.6.0

THIRD

public static final int THIRD
Deprecated. 
Represents the third week of the month.
Since:
JDE 3.6.0

FOURTH

public static final int FOURTH
Deprecated. 
Represents the fourth week of the month.
Since:
JDE 3.6.0

FIFTH

public static final int FIFTH
Deprecated. 
Represents the fifth week of the month.
Since:
JDE 3.6.0

LAST

public static final int LAST
Deprecated. 
Represents the last week of the month.
Since:
JDE 3.6.0

SECONDLAST

public static final int SECONDLAST
Deprecated. 
Represents the second last week of the month.
Since:
JDE 3.6.0

THIRDLAST

public static final int THIRDLAST
Deprecated. 
Represents the third last week of the month.
Since:
JDE 3.6.0

FOURTHLAST

public static final int FOURTHLAST
Deprecated. 
Represents the fourth last week of the month.
Since:
JDE 3.6.0

FIFTHLAST

public static final int FIFTHLAST
Deprecated. 
Represents the fifth last week of the month.
Since:
JDE 3.6.0

SATURDAY

public static final int SATURDAY
Deprecated. 
Represents the constant for the day: Saturday.
Since:
JDE 3.6.0

FRIDAY

public static final int FRIDAY
Deprecated. 
Represents the constant for the day: Friday.
Since:
JDE 3.6.0

THURSDAY

public static final int THURSDAY
Deprecated. 
Represents the constant for the day: Thursday.
Since:
JDE 3.6.0

WEDNESDAY

public static final int WEDNESDAY
Deprecated. 
Represents the constant for the day: Wednesday.
Since:
JDE 3.6.0

TUESDAY

public static final int TUESDAY
Deprecated. 
Represents the constant for the day: Tuesday.
Since:
JDE 3.6.0

MONDAY

public static final int MONDAY
Deprecated. 
Represents the constant for the day: Monday.
Since:
JDE 3.6.0

SUNDAY

public static final int SUNDAY
Deprecated. 
Represents the constant for the day: Sunday.
Since:
JDE 3.6.0

JANUARY

public static final int JANUARY
Deprecated. 
Represents the constant for the month: January.
Since:
JDE 3.6.0

FEBRUARY

public static final int FEBRUARY
Deprecated. 
Represents the constant for the month: February.
Since:
JDE 3.6.0

MARCH

public static final int MARCH
Deprecated. 
Represents the constant for the month: March.
Since:
JDE 3.6.0

APRIL

public static final int APRIL
Deprecated. 
Represents the constant for the month: April.
Since:
JDE 3.6.0

MAY

public static final int MAY
Deprecated. 
Represents the constant for the month: May.
Since:
JDE 3.6.0

JUNE

public static final int JUNE
Deprecated. 
Represents the constant for the month: June.
Since:
JDE 3.6.0

JULY

public static final int JULY
Deprecated. 
Represents the constant for the month: July.
Since:
JDE 3.6.0

AUGUST

public static final int AUGUST
Deprecated. 
Represents the constant for the month: August.
Since:
JDE 3.6.0

SEPTEMBER

public static final int SEPTEMBER
Deprecated. 
Represents the constant for the month: September.
Since:
JDE 3.6.0

OCTOBER

public static final int OCTOBER
Deprecated. 
Represents the constant for the month: October.
Since:
JDE 3.6.0

NOVEMBER

public static final int NOVEMBER
Deprecated. 
Represents the constant for the month: November.
Since:
JDE 3.6.0

DECEMBER

public static final int DECEMBER
Deprecated. 
Represents the constant for the month: December.
Since:
JDE 3.6.0
Constructor Detail

RepeatRule

public RepeatRule()
Deprecated. 
Creates a new RepeatRule instance.
Since:
JDE 3.6.0
Method Detail

dates

public Enumeration dates(long startDate,
                         long subsetBeginning,
                         long subsetEnding)
Deprecated. 
Returns an enumeration of event dates, ordered by date, between the specified subsetBeginning and subsetEnding parameters.

Excepted dates (as excepted by the addExceptDate(long) method), are events which will not occur.

Parameters:
startDate - The start date for which to begin.
subsetBeginning - The starting date for which to return event dates.
subsetEnding - The ending date for which to return end dates. The value null specifies that no more events occur.
Returns:
An enumeration of event dates given the start date and end date.
Since:
JDE 4.0.2

addExceptDate

public void addExceptDate(long date)
Deprecated. 
Adds a date for which the event will not occur.

Parameters:
date - The date to remove from the list of except dates expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).
Since:
JDE 4.0.2

removeExceptDate

public void removeExceptDate(long date)
Deprecated. 
Removes an excepted date from the RepeatRule.

Parameters:
date - The date to remove from the list of except dates expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).
Since:
JDE 4.0.2

getExceptDates

public long[] getExceptDates()
Deprecated. 
Returns an array containing the dates on which the RepeatRule will not occur.

Returns:
An array of longs representing the excepted dates.
Since:
JDE 3.6.0

getInt

public int getInt(int field)
Deprecated. 
Returns an integer representing a RepeatRule field value.

The value can be one of the following: COUNT, DAYNUMBER, FREQUENCY, INTERVAL, MONTH_IN_YEAR, WEEK_IN_MONTH, DAY_IN_WEEK, DAY_IN_YEAR.

Parameters:
field - The field for which to return the integer value.
Returns:
An integer representing the field value.
Throws:
IllegalArgumentException - Thrown if the specifed field is not valid.
Since:
JDE 4.0.2

setInt

public void setInt(int field,
                   int value)
Deprecated. 
Sets an integer that specifies a RepeatRule field and value.

Parameters:
field - An integer represnting the field to set.
value - An integer representing the value to set. Setting the field to null clears it.
Throws:
IllegalArgumentException - Thrown if field is not one of the the valid RepeatRule fields for this method, or if value is not a valid value for field
Since:
JDE 4.0.2

getDate

public long getDate(int field)
Deprecated. 
Returns the date of the specified field.

The field value is currently limited to END.

Parameters:
field - The field for which to return the date value.
Returns:
A long (MS format) representing the date. The value 0 indicates that the field has not been set.
Throws:
IllegalArgumentException - Thrown if the field is not one of the the valid RepeatRule fields for this method, or if the value is not a valid value for field.
Since:
JDE 4.0.2

setDate

public void setDate(int field,
                    long value)
Deprecated. 
Sets a date for the specified field.

The field value is currently limited to END.

Parameters:
field - The field for which to set the date.
value - The long value to set the date to.
Throws:
IllegalArgumentException - Thrown if the field is not one of the the valid RepeatRule fields for this method, or if the value is not a valid value for field.
Since:
JDE 4.0.2

getFields

public int[] getFields()
Deprecated. 
Returns an array of integers representing the fields in the RepeatRule.

Returns:
An integer array.
Since:
JDE 3.6.0

equals

public boolean equals(Object obj)
Deprecated. 
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

  • It is reflexive: for any reference value x, x.equals(x) should return true.
  • It is symmetric: for any reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the object is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

Overrides:
equals in class Object
Since:
JDE 4.0.2


Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.