com.webmethods.caf.faces.data.calendar
Class CalendarEvent

java.lang.Object
  extended by com.webmethods.caf.faces.data.calendar.CalendarEvent
All Implemented Interfaces:
ICalendarEvent, Comparable

public class CalendarEvent
extends Object
implements ICalendarEvent

Calendar event. Defines the date range for this event. Contains the event header, body, and type.


Field Summary
protected  boolean m_allDay
           
protected  Date m_endDate
           
protected  String m_eventBody
           
protected  String m_eventHeader
           
protected  String m_eventStyle
           
protected  String m_eventType
           
 
Constructor Summary
protected CalendarEvent()
          Default constructor
 
Method Summary
 int compareTo(ICalendarEvent that)
          Implementation of Comparable Calendar Event Overrides Comparable implementation of compareTo.
static CalendarEvent create(Date start, Date end, boolean allDay, String header, String body, String type)
          Creates a Calendar Event and initialize it.
 Date getEndDate()
          Get end date of this event.
 String getEventBody()
          Get the text of the event body.
 String getEventHeader()
          Get event header that describes this event.
 String getEventType()
          Get event type that for this event.
 Date getStartDate()
          Get start date of this event.
 boolean isAllDay()
          Does this event start and end the same date as a Day unit.
 void setAllDay(boolean day)
          Set this event to start and end the same date as a Day unit.
 void setEndDate(Date date)
          Set the Date this event ends on.
 void setEventBody(String body)
          Set the text of the event body.
 void setEventHeader(String header)
          Set event header that describes this event.
 void setEventType(String type)
          Set event type that for this event.
 void setStartDate(Date m_startDate)
          Set the date this event starts on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_endDate

protected Date m_endDate

m_allDay

protected boolean m_allDay

m_eventHeader

protected String m_eventHeader

m_eventBody

protected String m_eventBody

m_eventStyle

protected String m_eventStyle

m_eventType

protected String m_eventType
Constructor Detail

CalendarEvent

protected CalendarEvent()
Default constructor

Method Detail

create

public static CalendarEvent create(Date start,
                                   Date end,
                                   boolean allDay,
                                   String header,
                                   String body,
                                   String type)
Creates a Calendar Event and initialize it.

Parameters:
start - Date The date this event starts on. Should not be null.
end - Date The date this event ends on. Should not be null.
allDay - boolean this event to start and end on the same date as a Day unit
header - String A text header used as a title or description of this event.
body - String The description and information for this event.
type - String A user defined value for defining the type of event.
Returns:
CalendarEvent

setStartDate

public void setStartDate(Date m_startDate)
Set the date this event starts on.

Parameters:
m_startDate - The start date set for this event.

getStartDate

public Date getStartDate()
Get start date of this event.

Specified by:
getStartDate in interface ICalendarEvent
Returns:
The start date set for this event.

getEndDate

public Date getEndDate()
Get end date of this event.

Specified by:
getEndDate in interface ICalendarEvent
Returns:
The end date set for this event.

setEndDate

public void setEndDate(Date date)
Set the Date this event ends on.

Parameters:
date - Date The end date for this event.

isAllDay

public boolean isAllDay()
Does this event start and end the same date as a Day unit.

Specified by:
isAllDay in interface ICalendarEvent
Returns:
boolean true if this event starts and ends the same date as a Day unit. Otherwise false;

setAllDay

public void setAllDay(boolean day)
Set this event to start and end the same date as a Day unit.

Parameters:
day - true - then this event starts and ends the same date as a Day unit.
See Also:
ICalendarProvider

getEventBody

public String getEventBody()
Get the text of the event body.

Specified by:
getEventBody in interface ICalendarEvent
Returns:
String Content of this event.

setEventBody

public void setEventBody(String body)
Set the text of the event body.

Parameters:
body - The Content of this event.

getEventHeader

public String getEventHeader()
Get event header that describes this event. May be considered a title of this event.

Specified by:
getEventHeader in interface ICalendarEvent
Returns:
String The description or title of this event.

setEventHeader

public void setEventHeader(String header)
Set event header that describes this event. May be considered a title of this event.

Parameters:
header - The description or title of this event.

getEventType

public String getEventType()
Get event type that for this event. A user defined value for defining the type of event.

Specified by:
getEventType in interface ICalendarEvent
Returns:
String A user defined type for this event.

setEventType

public void setEventType(String type)
Set event type that for this event. A user defined value for defining the type of event.

Parameters:
type - String A user defined type for this event.

compareTo

public int compareTo(ICalendarEvent that)
Implementation of Comparable Calendar Event Overrides Comparable implementation of compareTo. Compares start date then end date.

Specified by:
compareTo in interface Comparable
Parameters:
that - ICalendarEvent event to compare this event to.
Returns:
-1 if before, 0 if equal, 1 if after.