Compoze Software, Inc.

portlets.compoze.groupware
Class RepeatPattern


java.lang.Object

  |

  +--portlets.compoze.groupware.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

Inner Class Summary
static class RepeatPattern.ByWeek
          This class represents the by weeks.
static class RepeatPattern.Day
          This class represents the day.
static class RepeatPattern.Interval
          This class represents the repeating interval.
static class RepeatPattern.MonthDayFormat
          This class provider utility methods for formatting repeating month-day patterns.
static class RepeatPattern.MonthlyInterval
          This class represents the monthly interval.
static class RepeatPattern.RepeatFor
          This class stores values for repeating 'for'.
static class RepeatPattern.Type
          This class stores values for repeating types.
static class RepeatPattern.Weekends
          This class represents the weekends.
 
Field Summary
static int UPDATE_RULE_ALL
           
static int UPDATE_RULE_INSTANCE
           
 
Constructor Summary
RepeatPattern(RepeatPattern.Type type, java.util.Date startDate, RepeatPattern.Interval interval, java.util.Date untilDate, int iOccurrences, int[] iWeeklyDays, RepeatPattern.RepeatFor repeatFor)
          Constructor.
 
Method Summary
static RepeatPattern createAnnual(java.util.Date startDate, RepeatPattern.Interval interval)
          Creates an annual repeating pattern (always).
static RepeatPattern createAnnual(java.util.Date startDate, RepeatPattern.Interval interval, java.util.Date untilDate)
          Creates an annual repeating pattern.
static RepeatPattern createAnnual(java.util.Date startDate, RepeatPattern.Interval interval, int iOccurrences)
          Creates an annual repeating pattern.
static RepeatPattern createAnnual(java.util.Date startDate, RepeatPattern.Interval interval, RepeatPattern.RepeatFor repeatFor)
          Creates an annual repeating pattern.
static RepeatPattern createDaily(java.util.Date startDate, RepeatPattern.Interval interval)
          Creates a daily repeating pattern (always).
static RepeatPattern createDaily(java.util.Date startDate, RepeatPattern.Interval interval, java.util.Date untilDate)
          Creates a daily repeating pattern.
static RepeatPattern createDaily(java.util.Date startDate, RepeatPattern.Interval interval, int iOccurrences)
          Creates a daily repeating pattern.
static RepeatPattern createDaily(java.util.Date startDate, RepeatPattern.Interval interval, RepeatPattern.RepeatFor repeatFor)
          Creates a daily repeating pattern.
static RepeatPattern createMonthly(java.util.Date startDate, RepeatPattern.Interval interval)
          Creates a monthly repeating pattern (always).
static RepeatPattern createMonthly(java.util.Date startDate, RepeatPattern.Interval interval, java.util.Date untilDate)
          Creates a monthly repeating pattern.
static RepeatPattern createMonthly(java.util.Date startDate, RepeatPattern.Interval interval, int iOccurrences)
          Creates a monthly repeating pattern.
static RepeatPattern createMonthly(java.util.Date startDate, RepeatPattern.Interval interval, RepeatPattern.RepeatFor repeatFor)
          Creates a monthly repeating pattern.
static RepeatPattern createWeekly(java.util.Date startDate, RepeatPattern.Interval interval)
          Creates a weekly repeating pattern (always).
static RepeatPattern createWeekly(java.util.Date startDate, RepeatPattern.Interval interval, java.util.Date untilDate)
          Creates a weekly repeating pattern.
static RepeatPattern createWeekly(java.util.Date startDate, RepeatPattern.Interval interval, int iOccurrences)
          Creates a weekly repeating pattern.
static RepeatPattern createWeekly(java.util.Date startDate, RepeatPattern.Interval interval, RepeatPattern.RepeatFor repeatFor)
          Creates a weekly repeating pattern.
 RepeatPattern.Interval getInterval()
          Gets the interval.
 int[] getMonthlyDays()
          Gets the monthly days.
 int getOccurrences()
          Gets the number of occurrences.
 RepeatPattern.RepeatFor getRepeatFor()
          Gets the repeat for.
 java.util.Date getStartDate()
          Gets the start date.
 RepeatPattern.Type getType()
          Gets the type.
 java.util.Date getUntilDate()
          Gets the until date.
 RepeatPattern.Weekends getWeekends()
          Gets the weekends.
 int[] getWeeklyDays()
          Gets the weekly days.
 boolean isAlways()
          Checks if this pattern repeats always.
 void setMonthlyDays(int[] iMonthlyDays)
          Sets the monthly days.
 void setStartDate(java.util.Date startDate)
          Sets the start date.
 void setWeekends(RepeatPattern.Weekends weekends)
          Sets the weekends.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_RULE_ALL


public static final int UPDATE_RULE_ALL

UPDATE_RULE_INSTANCE


public static final int UPDATE_RULE_INSTANCE
Constructor Detail

RepeatPattern


public RepeatPattern(RepeatPattern.Type type,
                     java.util.Date startDate,
                     RepeatPattern.Interval interval,
                     java.util.Date untilDate,
                     int iOccurrences,
                     int[] iWeeklyDays,
                     RepeatPattern.RepeatFor repeatFor)
              throws InvalidPatternException
Constructor.
Parameters:
type - the repeat type (may not be null)
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
untilDate - the until date (must be after the start date)
iOccurrences - the number of occurrences
iWeeklyDays - an array of days (see SUNDAY-SATURDAY constants)
repeatFor - the repeat for or null for none
Method Detail

getRepeatFor


public RepeatPattern.RepeatFor getRepeatFor()
Gets the repeat for.
Returns:
the repeat for or null if not set

getOccurrences


public int getOccurrences()
Gets the number of occurrences.
Returns:
the number of occurrences or 0 if not set

getInterval


public RepeatPattern.Interval getInterval()
Gets the interval.
Returns:
the interval

getType


public RepeatPattern.Type getType()
Gets the type.
Returns:
the type

isAlways


public boolean isAlways()
Checks if this pattern repeats always.
Returns:
true if this pattern repeats always; false otherwise

getUntilDate


public java.util.Date getUntilDate()
Gets the until date.
Returns:
the until date or null if not set

getStartDate


public java.util.Date getStartDate()
Gets the start date.
Returns:
the start date

setStartDate


public void setStartDate(java.util.Date startDate)
Sets the start date.
Parameters:
startDate - the start date

getWeekends


public RepeatPattern.Weekends getWeekends()
Gets the weekends.
Returns:
the weekends

getWeeklyDays


public int[] getWeeklyDays()
Gets the weekly days.
Returns:
the weekly days

getMonthlyDays


public int[] getMonthlyDays()
Gets the monthly days.
Returns:
the monthly days

setMonthlyDays


public void setMonthlyDays(int[] iMonthlyDays)
Sets the monthly days.
Parameters:
iMonthlyDays - the monthly days

setWeekends


public void setWeekends(RepeatPattern.Weekends weekends)
Sets the weekends.
Parameters:
weekends - the weekends

createDaily


public static RepeatPattern createDaily(java.util.Date startDate,
                                        RepeatPattern.Interval interval)
                                 throws InvalidPatternException
Creates a daily repeating pattern (always).
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
Returns:
the repeating pattern

createDaily


public static RepeatPattern createDaily(java.util.Date startDate,
                                        RepeatPattern.Interval interval,
                                        java.util.Date untilDate)
                                 throws InvalidPatternException
Creates a daily repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern

createDaily


public static RepeatPattern createDaily(java.util.Date startDate,
                                        RepeatPattern.Interval interval,
                                        int iOccurrences)
                                 throws InvalidPatternException
Creates a daily repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
iOccurrences - the number of occurrences
Returns:
the repeating pattern

createDaily


public static RepeatPattern createDaily(java.util.Date startDate,
                                        RepeatPattern.Interval interval,
                                        RepeatPattern.RepeatFor repeatFor)
                                 throws InvalidPatternException
Creates a daily repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
repeatFor - the repeat for (may not be null)
Returns:
the repeating pattern

createAnnual


public static RepeatPattern createAnnual(java.util.Date startDate,
                                         RepeatPattern.Interval interval)
                                  throws InvalidPatternException
Creates an annual repeating pattern (always).
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
Returns:
the repeating pattern

createAnnual


public static RepeatPattern createAnnual(java.util.Date startDate,
                                         RepeatPattern.Interval interval,
                                         java.util.Date untilDate)
                                  throws InvalidPatternException
Creates an annual repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern

createAnnual


public static RepeatPattern createAnnual(java.util.Date startDate,
                                         RepeatPattern.Interval interval,
                                         int iOccurrences)
                                  throws InvalidPatternException
Creates an annual repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
iOccurrences - the number of occurrences
Returns:
the repeating pattern

createAnnual


public static RepeatPattern createAnnual(java.util.Date startDate,
                                         RepeatPattern.Interval interval,
                                         RepeatPattern.RepeatFor repeatFor)
                                  throws InvalidPatternException
Creates an annual repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
repeatFor - the repeat for (may not be null)
Returns:
the repeating pattern

createWeekly


public static RepeatPattern createWeekly(java.util.Date startDate,
                                         RepeatPattern.Interval interval,
                                         int iOccurrences)
                                  throws InvalidPatternException
Creates a weekly repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
iOccurrences - the number of occurrences
Returns:
the repeating pattern

createWeekly


public static RepeatPattern createWeekly(java.util.Date startDate,
                                         RepeatPattern.Interval interval,
                                         java.util.Date untilDate)
                                  throws InvalidPatternException
Creates a weekly repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern

createWeekly


public static RepeatPattern createWeekly(java.util.Date startDate,
                                         RepeatPattern.Interval interval)
                                  throws InvalidPatternException
Creates a weekly repeating pattern (always).
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
Returns:
the repeating pattern

createWeekly


public static RepeatPattern createWeekly(java.util.Date startDate,
                                         RepeatPattern.Interval interval,
                                         RepeatPattern.RepeatFor repeatFor)
                                  throws InvalidPatternException
Creates a weekly repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
repeatFor - the repeat for (may not be null)
Returns:
the repeating pattern

createMonthly


public static RepeatPattern createMonthly(java.util.Date startDate,
                                          RepeatPattern.Interval interval,
                                          int iOccurrences)
                                   throws InvalidPatternException
Creates a monthly repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
iOccurrences - the number of occurrences
Returns:
the repeating pattern

createMonthly


public static RepeatPattern createMonthly(java.util.Date startDate,
                                          RepeatPattern.Interval interval,
                                          java.util.Date untilDate)
                                   throws InvalidPatternException
Creates a monthly repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
untilDate - the until date (may not be null and must be after the start date)
Returns:
the repeating pattern

createMonthly


public static RepeatPattern createMonthly(java.util.Date startDate,
                                          RepeatPattern.Interval interval)
                                   throws InvalidPatternException
Creates a monthly repeating pattern (always).
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
Returns:
the repeating pattern

createMonthly


public static RepeatPattern createMonthly(java.util.Date startDate,
                                          RepeatPattern.Interval interval,
                                          RepeatPattern.RepeatFor repeatFor)
                                   throws InvalidPatternException
Creates a monthly repeating pattern.
Parameters:
startDate - the start date (may not be null)
interval - the interval (i.e. every, every other, every third)
repeatFor - the repeat for (may not be null)
Returns:
the repeating pattern

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.