com.funambol.common.pim.model.calendar
Class ExceptionToRecurrenceRule

java.lang.Object
  extended by com.funambol.common.pim.model.calendar.ExceptionToRecurrenceRule
All Implemented Interfaces:
java.lang.Comparable<ExceptionToRecurrenceRule>

public class ExceptionToRecurrenceRule
extends java.lang.Object
implements java.lang.Comparable<ExceptionToRecurrenceRule>

This class represents the removal, the addition or the change of a particular occurrence in the context of a recurrence rule.

Version:
$Id: ExceptionToRecurrenceRule.java,v 1.4 2008-06-24 11:43:34 mauro Exp $

Constructor Summary
ExceptionToRecurrenceRule(boolean rdate, java.lang.String date)
          Creates a new instance of ExceptionToRecurrenceRule.
 
Method Summary
 int compareTo(ExceptionToRecurrenceRule e)
           
 boolean equals(java.lang.Object object)
           
 java.lang.String getDate()
          Gets the date value, which means the deleted occurrence if isAddition() returns false, the added occurrence otherwise.
 int hashCode()
           
 boolean isAddition()
          Returns whether the exception is an addition or a removal.
 void setAddition(boolean addition)
          Setter for property addition.
 void setDate(java.lang.String date)
          Sets the date value, which means the deleted or the added occurrence.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionToRecurrenceRule

public ExceptionToRecurrenceRule(boolean rdate,
                                 java.lang.String date)
                          throws java.text.ParseException
Creates a new instance of ExceptionToRecurrenceRule.

Parameters:
rdate - true if it's an addition to the recurrence rule, false if it's a deletion
date - as a String in "yyyyMMdd'T'HHmmssZ", "yyyyMMdd'T'HHmmss", "yyyy-MM-dd" or "yyMMdd" format
Throws:
java.text.ParseException - if date could not be interpreted
Method Detail

getDate

public java.lang.String getDate()
Gets the date value, which means the deleted occurrence if isAddition() returns false, the added occurrence otherwise.

Returns:
date as a String in "yyyyMMdd'T'HHmmssZ", "yyyyMMdd'T'HHmmss" or "yyyy-MM-dd" format

setDate

public void setDate(java.lang.String date)
             throws java.text.ParseException
Sets the date value, which means the deleted or the added occurrence. The date format is turned into one of the three accepted formats in the process ("yyyyMMdd'T'HHmmssZ", "yyyyMMdd'T'HHmmss" or "yyyy-MM-dd").

Parameters:
date - as a String in any ISO 8601 format
Throws:
java.text.ParseException - if date could not be interpreted

isAddition

public boolean isAddition()
Returns whether the exception is an addition or a removal.

Returns:
true if it is an addition ("positive exception"), false if it is a removal ("negative exception")

setAddition

public void setAddition(boolean addition)
Setter for property addition.

Parameters:
addition - new value of property addition (true if it is a positive exception, false if it is a negative one)

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(ExceptionToRecurrenceRule e)
Specified by:
compareTo in interface java.lang.Comparable<ExceptionToRecurrenceRule>


Copyright © 2001-2009 Funambol.