Compoze Software, Inc.

com.compoze.calendar
Class Appointments


java.lang.Object

  |

  +--com.compoze.calendar.Appointments

All Implemented Interfaces:
java.io.Serializable

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

This class represents a collection of appointments. The appointments collection may be used to iterate through appointments. By default, the appointments are sorted by start date in ascending order.

The appointments collection may also be used for searching. The following code segment shows how to reduce the appointments that are returned in the collection to ones with after a particular start date and implies sorting:

 CalendarSession s = CalendarSession.getSession(user);
 Appointments	apts = s.getAppointments();

 Date	startDate = ...some start date...
 Date	endDate = ...some end date...

 AppointmentFilter filter = new AppointmentFilter();
 filter.setDates(startDate, endDate);	// filter by a range

 apts.setFilter(filter);
 apts.sort(SortOrder.ASCENDING, AppointmentProperty.START_DATE);

 Iterator	it = apts.appointments().iterator();
 while(it.hasNext())
	{
	Appointment	apt = (Appointment)it.next();
	...
  }

 

See Also:
Serialized Form

Field Summary
protected  CalendarSession m_session
           
 
Method Summary
 Appointment add()
          Adds an appointment to the collection.
 AppointmentList appointments()
          Gets the list of all appointments the authenticated user has READ access to.
 void clearFilter()
          Clears the appointment filter for this collection of appointments.
 void clearSort()
          Clears the appointment sorting for this collection of appointments.
 Appointment getAppointment(long lAptID)
          Gets a appointment with the given appointment id.
 Appointment getAppointment(long lAptID, java.util.Date instanceDate)
          Gets a appointment with the given appointment id.
 int getCount()
          Gets the number of appointments in the collection.
 AppointmentFilter getFilter()
          Gets the appointment filter.
 SortOrder getSort()
          Gets the sort order.
 AppointmentProperty[] getSortProperties()
          Gets the sort properties.
 AppointmentProperty getSortProperty()
          Gets the sort property.
 void setFilter(AppointmentFilter filter)
          Sets the appointment filter.
 void sort(SortOrder order, AppointmentProperty property)
          Sorts the appointments in the collection.
 void sort(SortOrder order, AppointmentProperty[] props)
          Sorts the appointments in the collection by multiple properties.
 java.lang.String toString()
          Returns the string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_session


protected CalendarSession m_session
Method Detail

add


public Appointment add()
Adds an appointment to the collection.
Returns:
the new appointment or null if create fails

setFilter


public void setFilter(AppointmentFilter filter)
Sets the appointment filter. The filter may be used to restrict the appointments that are returned by the collection. To clear the filter, use clearFilter().
Returns:
the appointment filter (may not be null)

getFilter


public AppointmentFilter getFilter()
Gets the appointment filter. The filter may be used to restrict the appointments that are returned by the collection.
Returns:
the appointment filter or null if no filter is set

clearFilter


public void clearFilter()
Clears the appointment filter for this collection of appointments.

appointments


public AppointmentList appointments()
Gets the list of all appointments the authenticated user has READ access to.
Returns:
the list of Appointment objects

getCount


public int getCount()
Gets the number of appointments in the collection. The filter for this collection is applied if one exists; therefore, the number represents the number of appointments satisfying the filter, not the total number of appointments.
Returns:
the number of appointments or -1 if a count is not available

getAppointment


public Appointment getAppointment(long lAptID)
                           throws java.security.AccessControlException
Gets a appointment with the given appointment id. If the requested appointment is recurring, the first instance date is used.
Parameters:
lAptID - the appointment id
Returns:
the appointment or null if not found
See Also:
getAppointment(long,Date)

getAppointment


public Appointment getAppointment(long lAptID,
                                  java.util.Date instanceDate)
                           throws java.security.AccessControlException
Gets a appointment with the given appointment id. If the requested appointment is recuring, use the instance date to specify the instance to get. By default, the first instance date is used.
Parameters:
lAptID - the appointment id
instanceDate - the instance date (ignored if not recuring appointment)
Returns:
the appointment or null if not found

sort


public void sort(SortOrder order,
                 AppointmentProperty property)
Sorts the appointments in the collection.
Parameters:
sortOrder - the sort order
property - the property to sort by

sort


public void sort(SortOrder order,
                 AppointmentProperty[] props)
Sorts the appointments in the collection by multiple properties. The first index in the property array is the primary sorting property, the second index is the secondary and so forth.
Parameters:
sortOrder - the sort order
props - the properties to sort by

clearSort


public void clearSort()
Clears the appointment sorting for this collection of appointments.

getSort


public SortOrder getSort()
Gets the sort order.
Returns:
the sort order or null if not sorting is imposed

getSortProperty


public AppointmentProperty getSortProperty()
Gets the sort property. If there is more than one sort property set, the primary (first) property is returned.
Returns:
the property to sort by or null if no property set
See Also:
getSortProperties()

getSortProperties


public AppointmentProperty[] getSortProperties()
Gets the sort properties.
Returns:
the properties to sort by or null if no property set

toString


public java.lang.String toString()
Returns the string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of this object

Compoze Software, Inc.

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