Oracle

com.compoze.domino
Class RepeatPattern

java.lang.Object
  extended by com.compoze.domino.RepeatPattern
All Implemented Interfaces:
java.io.Serializable

public class RepeatPattern
extends java.lang.Object
implements java.io.Serializable

This class represents the repeating pattern. A repeating pattern defines how an entity repeats, for example, daily. Use the methods starting with create to create common repeating patterns.

See Also:
Serialized Form

Field Summary
static int BYWEEK_FIFTH
          The value that represents the 'fifth week'.
static int BYWEEK_FIRST
          The value that represents the 'first week'.
static int BYWEEK_FOURTH
          The value that represents the 'fourth week'.
static int BYWEEK_SECOND
          The value that represents the 'second week'.
static int BYWEEK_THIRD
          The value that represents the 'third week'.
static int FRIDAY
          The value that represents the day Friday.
static int MONDAY
          The value that represents the day Monday.
static int SATURDAY
          The value that represents the day Saturday.
static int SUNDAY
          The value that represents the day Sunday.
static int THURSDAY
          The value that represents the day Thursday.
static int TUESDAY
          The value that represents the day Tuesday.
static int UPDATE_ALL
          The value that represents the update all rule.
static int UPDATE_THIS_INSTANCE
          The value that represents the update this instance rule.
static int WEDNESDAY
          The value that represents the day Wednesday.
 
Method Summary
static RepeatPattern createCustom(java.util.Date[] dates)
          Creates a custom repeating pattern.
static RepeatPattern createDaily(java.util.Date startDate, int iInterval, RepeatWeekends weekends, java.util.Date untilDate)
          Creates a daily repeating pattern.
static RepeatPattern createDaily(java.util.Date startDate, int iInterval, RepeatWeekends weekends, RepeatForUnit forUnit, int iFor)
          Creates a daily repeating pattern.
static RepeatPattern createMonthlyByDate(java.util.Date startDate, int iInterval, int[] daysOfMonth, RepeatWeekends weekends, java.util.Date untilDate)
          Creates a monthly by date repeating pattern.
static RepeatPattern createMonthlyByDate(java.util.Date startDate, int iInterval, int[] daysOfMonth, RepeatWeekends weekends, RepeatForUnit forUnit, int iFor)
          Creates a monthly by date repeating pattern.
static RepeatPattern createMonthlyByDay(java.util.Date startDate, int iInterval, int[] daysOfWeek, RepeatWeekends weekends, java.util.Date untilDate)
          Creates a monthly by day repeating pattern.
static RepeatPattern createMonthlyByDay(java.util.Date startDate, int iInterval, int[] daysOfWeek, RepeatWeekends weekends, RepeatForUnit forUnit, int iFor)
          Creates a monthly by day repeating pattern.
static RepeatPattern createWeekly(java.util.Date startDate, int iInterval, int[] daysOfWeek, RepeatWeekends weekends, java.util.Date untilDate)
          Creates a weekly repeating pattern.
static RepeatPattern createWeekly(java.util.Date startDate, int iInterval, int[] daysOfWeek, RepeatWeekends weekends, RepeatForUnit forUnit, int iFor)
          Creates a weekly repeating pattern.
static RepeatPattern createYearly(java.util.Date startDate, int iInterval, RepeatWeekends weekends, java.util.Date untilDate)
          Creates a yearly repeating pattern.
static RepeatPattern createYearly(java.util.Date startDate, int iInterval, RepeatWeekends weekends, RepeatForUnit forUnit, int iFor)
          Creates a yearly repeating pattern.
 RepeatAdjust getAdjust()
          Gets the adjust for the repeat pattern.
static java.lang.String getDayByNumber(int iDay)
          Gets the localized string for a day.
static java.lang.String getDayByNumber(int iDay, int iFieldWidth, java.util.Calendar cal, java.util.Locale locale)
          Gets the localized string for a day.
static java.lang.String getDayByNumber(int iDay, java.util.Locale locale)
          Gets the localized string for a day.
 int getFor()
          Gets the repeat pattern for.
 RepeatForUnit getForUnit()
          Gets the repeat pattern for unit.
 RepeatHow getHow()
          Gets the repeat pattern how.
 java.util.Date[] getInstanceDates()
          Gets a list of the dates for the repeat pattern.
 int getInterval()
          Gets the repeat pattern interval.
 RepeatPattern getPatternInstance(java.util.Date startDate)
          Gets a new instance of the repeat pattern with the new start date.
 RepeatPattern getPatternInstance(java.util.Date startDate, java.util.Date untilDate)
          Gets a new instance of the repeat pattern with the new start date.
 java.util.List getPropertyValues()
          Gets a list of the values from the repeat pattern.
 RepeatWeekends getRepeatWeekends()
          Gets the repeat pattern weekends.
 java.util.Date getStartDate()
          Gets the start date for the repeat pattern.
 RepeatType getType()
          Gets the repeat pattern type.
 java.util.Date getUntilDate()
          Gets the until date for the repeat pattern.
static void main(java.lang.String[] args)
           
 void setStartDate(java.util.Date startDate)
          Sets the start date for the repeat pattern.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BYWEEK_FIRST

public static final int BYWEEK_FIRST
The value that represents the 'first week'.

See Also:
Constant Field Values

BYWEEK_SECOND

public static final int BYWEEK_SECOND
The value that represents the 'second week'.

See Also:
Constant Field Values

BYWEEK_THIRD

public static final int BYWEEK_THIRD
The value that represents the 'third week'.

See Also:
Constant Field Values

BYWEEK_FOURTH

public static final int BYWEEK_FOURTH
The value that represents the 'fourth week'.

See Also:
Constant Field Values

BYWEEK_FIFTH

public static final int BYWEEK_FIFTH
The value that represents the 'fifth week'.

See Also:
Constant Field Values

SUNDAY

public static final int SUNDAY
The value that represents the day Sunday.

See Also:
Constant Field Values

MONDAY

public static final int MONDAY
The value that represents the day Monday.

See Also:
Constant Field Values

TUESDAY

public static final int TUESDAY
The value that represents the day Tuesday.

See Also:
Constant Field Values

WEDNESDAY

public static final int WEDNESDAY
The value that represents the day Wednesday.

See Also:
Constant Field Values

THURSDAY

public static final int THURSDAY
The value that represents the day Thursday.

See Also:
Constant Field Values

FRIDAY

public static final int FRIDAY
The value that represents the day Friday.

See Also:
Constant Field Values

SATURDAY

public static final int SATURDAY
The value that represents the day Saturday.

See Also:
Constant Field Values

UPDATE_ALL

public static final int UPDATE_ALL
The value that represents the update all rule.

See Also:
Constant Field Values

UPDATE_THIS_INSTANCE

public static final int UPDATE_THIS_INSTANCE
The value that represents the update this instance rule.

See Also:
Constant Field Values
Method Detail

getPatternInstance

public RepeatPattern getPatternInstance(java.util.Date startDate)
                                 throws InvalidRuleException
Gets a new instance of the repeat pattern with the new start date. All other characteristics of the repeat pattern are preserved.

Parameters:
startDate - the start date (may not be null)
Returns:
the newly created repeat pattern
Throws:
InvalidRuleException

getPatternInstance

public RepeatPattern getPatternInstance(java.util.Date startDate,
                                        java.util.Date untilDate)
                                 throws InvalidRuleException
Gets a new instance of the repeat pattern with the new start date. All other characteristics of the repeat pattern are preserved.

Parameters:
startDate - the start date (may not be null)
untilDate - the until date (may not be null)
Returns:
the newly created repeat pattern
Throws:
InvalidRuleException

getAdjust

public RepeatAdjust getAdjust()
Gets the adjust for the repeat pattern.

Returns:
the repeat adjust

getType

public RepeatType getType()
Gets the repeat pattern type.

Returns:
the repeat pattern type

getUntilDate

public java.util.Date getUntilDate()
Gets the until date for the repeat pattern.

Returns:
the until date or null if the repeat how is until

getInterval

public int getInterval()
Gets the repeat pattern interval.

Returns:
the repeat pattern interval

getFor

public int getFor()
Gets the repeat pattern for.

Returns:
the repeat pattern for

getHow

public RepeatHow getHow()
Gets the repeat pattern how. This tell how long the repeat pattern will occur for either: until a specified date or for a certain amount of time.

Returns:
the repeat pattern how
See Also:
getUntilDate(), getFor(), getForUnit()

getForUnit

public RepeatForUnit getForUnit()
Gets the repeat pattern for unit.

Returns:
the repeat pattern for unit

getStartDate

public java.util.Date getStartDate()
Gets the start date for the repeat pattern.

Returns:
the start date

setStartDate

public void setStartDate(java.util.Date startDate)
                  throws InvalidRuleException,
                         DominoException
Sets the start date for the repeat pattern.

Parameters:
startDate - the start date (may not be null)
Throws:
InvalidRuleException
DominoException

getRepeatWeekends

public RepeatWeekends getRepeatWeekends()
Gets the repeat pattern weekends.

Returns:
the repeat pattern weekends

getInstanceDates

public java.util.Date[] getInstanceDates()
Gets a list of the dates for the repeat pattern. These are the instance dates for this repeating pattern.

Returns:
an array of dates

getPropertyValues

public java.util.List getPropertyValues()
Gets a list of the values from the repeat pattern.

Returns:
a list of PropertyValue objects (unmodifiable)

createDaily

public static RepeatPattern createDaily(java.util.Date startDate,
                                        int iInterval,
                                        RepeatWeekends weekends,
                                        java.util.Date untilDate)
                                 throws InvalidRuleException
Creates a daily repeating pattern.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
weekends - the weekends rule (may not be null
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createDaily

public static RepeatPattern createDaily(java.util.Date startDate,
                                        int iInterval,
                                        RepeatWeekends weekends,
                                        RepeatForUnit forUnit,
                                        int iFor)
                                 throws InvalidRuleException
Creates a daily repeating pattern.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
weekends - the weekends rule (may not be null
forUnit - the for unit
iFor - the number of for units
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createCustom

public static RepeatPattern createCustom(java.util.Date[] dates)
                                  throws InvalidRuleException
Creates a custom repeating pattern.

Parameters:
dates - the dates for the repeating pattern
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createYearly

public static RepeatPattern createYearly(java.util.Date startDate,
                                         int iInterval,
                                         RepeatWeekends weekends,
                                         java.util.Date untilDate)
                                  throws InvalidRuleException
Creates a yearly repeating pattern.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
weekends - the weekends rule (may not be null
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createYearly

public static RepeatPattern createYearly(java.util.Date startDate,
                                         int iInterval,
                                         RepeatWeekends weekends,
                                         RepeatForUnit forUnit,
                                         int iFor)
                                  throws InvalidRuleException
Creates a yearly repeating pattern.

When setting the for unit and number of units, since this is a yearly repeating pattern, the for unit must be at a minimum RepeatForUnit.YEARS. If not, there could potentially be no instance dates for the pattern therefore creating an invalid pattern. If you pass in a for unit less than RepeatForUnit.YEARS, the for unit is automatically adjusted.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
weekends - the weekends rule (may not be null
forUnit - the for unit (minimum RepeatForUnit.YEARS)
iFor - the number of for units
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createWeekly

public static RepeatPattern createWeekly(java.util.Date startDate,
                                         int iInterval,
                                         int[] daysOfWeek,
                                         RepeatWeekends weekends,
                                         java.util.Date untilDate)
                                  throws InvalidRuleException
Creates a weekly repeating pattern.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
daysOfWeek - the days of week (array of int of SUNDAY-SATURDAY constants)
weekends - the weekends rule (may not be null
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createWeekly

public static RepeatPattern createWeekly(java.util.Date startDate,
                                         int iInterval,
                                         int[] daysOfWeek,
                                         RepeatWeekends weekends,
                                         RepeatForUnit forUnit,
                                         int iFor)
                                  throws InvalidRuleException
Creates a weekly repeating pattern.

When setting the for unit and number of units, since this is a weekly repeating pattern, the for unit must be at a minimum RepeatForUnit.WEEKS. If not, there could potentially be no instance dates for the pattern therefore creating an invalid pattern. If you pass in a for unit less than RepeatForUnit.WEEKS, the for unit is automatically adjusted.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
daysOfWeek - the days of week (array of int of SUNDAY-SATURDAY constants)
weekends - the weekends rule (may not be null
forUnit - the for unit (minimum RepeatForUnit.WEEKS)
iFor - the number of for units
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createMonthlyByDate

public static RepeatPattern createMonthlyByDate(java.util.Date startDate,
                                                int iInterval,
                                                int[] daysOfMonth,
                                                RepeatWeekends weekends,
                                                java.util.Date untilDate)
                                         throws InvalidRuleException
Creates a monthly by date repeating pattern.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
daysOfMonth - the days of month (array of days, 1-31)
weekends - the weekends rule (may not be null
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createMonthlyByDate

public static RepeatPattern createMonthlyByDate(java.util.Date startDate,
                                                int iInterval,
                                                int[] daysOfMonth,
                                                RepeatWeekends weekends,
                                                RepeatForUnit forUnit,
                                                int iFor)
                                         throws InvalidRuleException
Creates a monthly by date repeating pattern.

When setting the for unit and number of units, since this is a monthly repeating pattern, the for unit must be at a minimum RepeatForUnit.MONTHS. If not, there could potentially be no instance dates for the pattern therefore creating an invalid pattern. If you pass in a for unit less than RepeatForUnit.MONTHS, the for unit is automatically adjusted.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
daysOfMonth - the days of month (array of days, 1-31)
weekends - the weekends rule (may not be null
forUnit - the for unit (minimum RepeatForUnit.MONTHS)
iFor - the number of for units
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createMonthlyByDay

public static RepeatPattern createMonthlyByDay(java.util.Date startDate,
                                               int iInterval,
                                               int[] daysOfWeek,
                                               RepeatWeekends weekends,
                                               java.util.Date untilDate)
                                        throws InvalidRuleException
Creates a monthly by day repeating pattern.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
daysOfWeek - the days of week (array of SUNDAY-SATURDAY constants possibly or'd with one of the BYWEEK_ constants)
weekends - the weekends rule (may not be null
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

createMonthlyByDay

public static RepeatPattern createMonthlyByDay(java.util.Date startDate,
                                               int iInterval,
                                               int[] daysOfWeek,
                                               RepeatWeekends weekends,
                                               RepeatForUnit forUnit,
                                               int iFor)
                                        throws InvalidRuleException
Creates a monthly by day repeating pattern.

When setting the for unit and number of units, since this is a monthly repeating pattern, the for unit must be at a minimum RepeatForUnit.MONTHS. If not, there could potentially be no instance dates for the pattern therefore creating an invalid pattern. If you pass in a for unit less than RepeatForUnit.MONTHS, the for unit is automatically adjusted.

Parameters:
startDate - the start date (may not be null)
iInterval - the interval (i.e. every, every other, every third)
daysOfWeek - the days of week (array of SUNDAY-SATURDAY constants possibly or'd with one of the BYWEEK_ constants)
weekends - the weekends rule (may not be null
forUnit - the for unit (minimum RepeatForUnit.MONTHS)
iFor - the number of for units
Returns:
the repeating pattern
Throws:
InvalidRuleException - if the specified rule is invalid

getDayByNumber

public static java.lang.String getDayByNumber(int iDay)
Gets the localized string for a day.

Parameters:
iDay - day number (see SUNDAY-SATURDAY constants)
Returns:
localized string for a day

getDayByNumber

public static java.lang.String getDayByNumber(int iDay,
                                              java.util.Locale locale)
Gets the localized string for a day.

Parameters:
iDay - day number (see SUNDAY-SATURDAY constants)
locale - locale to use
Returns:
localized string for a day

getDayByNumber

public static java.lang.String getDayByNumber(int iDay,
                                              int iFieldWidth,
                                              java.util.Calendar cal,
                                              java.util.Locale locale)
Gets the localized string for a day.

Parameters:
iDay - day number (see SUNDAY-SATURDAY constants)
iFieldWidth - width of day field
locale - locale to use
cal - calendar to use
Returns:
localized string for a day

toString

public java.lang.String toString()
Returns the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this object

main

public static void main(java.lang.String[] args)

Oracle

Copyright ©1999-2008 Oracle All rights reserved.