com.bradrydzewski.gwt.calendar.client
Class Appointment

java.lang.Object
  extended by com.bradrydzewski.gwt.calendar.client.Appointment
All Implemented Interfaces:
Serializable, Comparable<Appointment>

public class Appointment
extends Object
implements Comparable<Appointment>, Serializable

Represents an event that Calendar Views display and manipulate through the gwt-cal provided user interface elements.

The Appointment class provides a set of text-based properties to describe it, including a title, description, location, createdBy, etc. Additional to these, there is a set of properties that exist to provide the gwt-cal components with information useful during the Appointment rendering in the widget views (allDay, recurring, etc.)

All Appointment properties are ultimately used by the gwt-cal views and it is up to these components to decide how to render (if at all) them as well as to provide appropriate runtime features to modify them.

Author:
Brad Rydzewski, Carlos D. Morales
See Also:
Serialized Form

Constructor Summary
Appointment()
           Creates an Appointment with the following attributes set to null title description start end location createdBy the attendees collection empty and the allDay property false.
 
Method Summary
 Appointment clone()
           
 int compareTo(Appointment appointment)
          Compares this Appointment with the specified appointment based first on the start dates of each appointment and then (if they happen to be the same), on the end dates.
 List<Attendee> getAttendees()
          Returns the collection of associated attendees.
 String getCreatedBy()
          Returns a creator of this Appointment.
 String getCustomStyle()
           
 String getDescription()
          Returns a description for this Appointment.
 Date getEnd()
          Returns the configured end time-stamp of this Appointment.
 String getId()
          Returns the unique identifier for this Appointment.
 String getLocation()
          Returns a location of this Appointment.
 Date getStart()
          Returns the configured start time-stamp of this Appointment.
 AppointmentStyle getStyle()
           
 String getTitle()
          Returns the identifying title of this Appointment.
 boolean isAllDay()
          Returns the configured value of the allDay property, which indicates if this Appointment should be considered as spanning all day.
 boolean isMultiDay()
          Tells whether this Appointment spans more than a single day, based on its start and end properties.
 boolean isReadOnly()
           
 void setAllDay(boolean allDay)
          Configures the the allDay property, which indicates if this Appointment should be considered as spanning all day.
 void setAttendees(List<Attendee> attendees)
          Sets the attendees associated to this Appointment.
 void setCreatedBy(String createdBy)
          Sets the creator of this Appointment.
 void setCustomStyle(String customStyle)
           
 void setDescription(String description)
          Sets the description of this Appointment.
 void setEnd(Date end)
          Sets the end time-stamp of this Appointment.
 void setId(String id)
          Sets the unique identifier of this Appointment.
 void setLocation(String location)
          Sets the location of this Appointment.
 void setReadOnly(boolean readOnly)
           
 void setStart(Date start)
          Sets the start time-stamp of this Appointment.
 void setStyle(AppointmentStyle style)
           
 void setTitle(String title)
          Sets the identifying title of this Appointment.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Appointment

public Appointment()

Creates an Appointment with the following attributes set to null

the attendees collection empty and the allDay property false.

Method Detail

getId

public String getId()
Returns the unique identifier for this Appointment. The field is optional (and not used by gwt-cal) and therefore may be null.

Returns:
A unique identifier for this Appointment (optional).

setId

public void setId(String id)
Sets the unique identifier of this Appointment. This identifier is optional.

Parameters:
id -

getStart

public Date getStart()
Returns the configured start time-stamp of this Appointment.

Returns:
A date object with the date and time this appointment starts on

setStart

public void setStart(Date start)
Sets the start time-stamp of this Appointment.

Parameters:
start - A date object with the date and time this appointment starts

getEnd

public Date getEnd()
Returns the configured end time-stamp of this Appointment.

Returns:
A date object with the date and time this appointment ends on

setEnd

public void setEnd(Date end)
Sets the end time-stamp of this Appointment.

Parameters:
end - A date object with the date and time this appointment starts

getTitle

public String getTitle()
Returns the identifying title of this Appointment.

Returns:
The title's short text

setTitle

public void setTitle(String title)
Sets the identifying title of this Appointment.

Parameters:
title - The title's short text

getDescription

public String getDescription()
Returns a description for this Appointment.

Returns:
The appointment's description

setDescription

public void setDescription(String description)
Sets the description of this Appointment.

Parameters:
description - The title's short text

getLocation

public String getLocation()
Returns a location of this Appointment.

Returns:
The appointment location.

setLocation

public void setLocation(String location)
Sets the location of this Appointment.

Parameters:
location - The appointment location

getCreatedBy

public String getCreatedBy()
Returns a creator of this Appointment.

Returns:
The appointment creator description.

setCreatedBy

public void setCreatedBy(String createdBy)
Sets the creator of this Appointment.

Parameters:
createdBy - The appointment creator description.

getAttendees

public List<Attendee> getAttendees()
Returns the collection of associated attendees.

Returns:
The currently configured list of attendees

setAttendees

public void setAttendees(List<Attendee> attendees)
Sets the attendees associated to this Appointment.

Parameters:
attendees - The entities associated (attending) this Appointment

compareTo

public int compareTo(Appointment appointment)
Compares this Appointment with the specified appointment based first on the start dates of each appointment and then (if they happen to be the same), on the end dates.

Specified by:
compareTo in interface Comparable<Appointment>
Parameters:
appointment - The appointment to compare this one to
Returns:
a negative integer if this appointment is before appointment, zero if both appointments have the same start/ end dates, and a positive integer if this appointment is after appointment.

isMultiDay

public boolean isMultiDay()
Tells whether this Appointment spans more than a single day, based on its start and end properties.

Returns:
true if the start and end dates fall on different dates, false otherwise.

isAllDay

public boolean isAllDay()
Returns the configured value of the allDay property, which indicates if this Appointment should be considered as spanning all day. It is left to the view rendering this Appointment to decide how to render an appointment based on this property value. For instance, the month view, will display the Appointment at the top of the days in a week.

Returns:
The current value of the allDay property

setAllDay

public void setAllDay(boolean allDay)
Configures the the allDay property, which indicates if this Appointment should be considered as spanning all day. It is left to the view rendering this Appointment to decide how to render an appointment based on this property value. For instance, the month view, will display the Appointment at the top of the days in a week.

Parameters:
allDay - The current value of the allDay property

clone

public Appointment clone()
Overrides:
clone in class Object

getStyle

public AppointmentStyle getStyle()

setStyle

public void setStyle(AppointmentStyle style)

getCustomStyle

public String getCustomStyle()

setCustomStyle

public void setCustomStyle(String customStyle)

isReadOnly

public boolean isReadOnly()

setReadOnly

public void setReadOnly(boolean readOnly)


Copyright © 2012. All Rights Reserved.