com.miginfocom.calendar.activity.recurrence
Class ByXXXRuleData

java.lang.Object
  extended by com.miginfocom.calendar.activity.recurrence.ByXXXRuleData
All Implemented Interfaces:
java.io.Serializable

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

Encapsulates all information in a ByXXXRule for a recurrence. See RFC 2445 for thorough information on ByXXXRules. No processing is done in this class, it only holds data.

RFC 2445

See Also:
Serialized Form

Constructor Summary
ByXXXRuleData(int calField, int[] values)
          Constructor.
ByXXXRuleData(int field, int[] values, int[] relativeWeekDayInYearOrMonth)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getCalendarField()
          Returns the field set in the constructor.
 int[] getRelativeWeekDayInYearOrMonth()
          Returns the reference to the argument set in the constructor.
 int[] getValues()
          Returns a reference to the argument set in the constructor.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByXXXRuleData

public ByXXXRuleData(int calField,
                     int[] values)
Constructor.

Parameters:
calField - The field to set the rule for. If of "larger type" the the frequency it generally reduces the recurrence set. If of a smaller value it generally increases the number of recurrencies. The "BYSETPOS" rule must be setted in a special method since it maps to no field in Calendar.
values - The values that field should be one of. Negative means relative to the upper boundary of field. Not null. E.g. one element can be Calendar.SUNDAY or Calendar.JANUARY.

ByXXXRuleData

public ByXXXRuleData(int field,
                     int[] values,
                     int[] relativeWeekDayInYearOrMonth)
Constructor.

Parameters:
field - The field to set the rule for. If of "larger type" the the frequency it generally reduces the recurrence set. If of a smaller value it generally increases the number of recurrencies. The "BYSETPOS" rule must be setted in a special method since it maps to no field in Calendar.
values - The values that field should be one of. Negative means relative to the upper boundary of field. Not null and must contain at least one element.
relativeWeekDayInYearOrMonth - For Monthly and Yearly frequency rules and a BYDAY (field == Calendar.DAY_OF_WEEK) a relative filter can be set saying for instance "Only first monday of year" or "third to last friday in the month". This is to include support for "1MO" and "-3FR" notations in the BYDAY rule. If this array is non-null it must match the length of values and every element specifies relative order in MONTH/YEAR if not set to 0 in which case that values means "every" as usual.

If field isn't DAY_OF_WEEK or the length doesn't match values an IllegalArgumentException is thrown. Also remember that this argument is only checked if the main recurrence field (as specified in the Recurrence rule) is MONTHLY or YEARLY.

Method Detail

getCalendarField

public int getCalendarField()
Returns the field set in the constructor.

Returns:
The field set in the constructor.

getRelativeWeekDayInYearOrMonth

public int[] getRelativeWeekDayInYearOrMonth()
Returns the reference to the argument set in the constructor.

Returns:
The reference to the argument set in the constructor.

getValues

public int[] getValues()
Returns a reference to the argument set in the constructor.

Returns:
The reference to the argument set in the constructor.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.