com.bradrydzewski.gwt.calendar.client.util
Class AppointmentUtil

java.lang.Object
  extended by com.bradrydzewski.gwt.calendar.client.util.AppointmentUtil

public class AppointmentUtil
extends Object

Utility class for several operations involving time and Appointment objects.

Author:
Brad Rydzewski, Carlos D. Morales

Constructor Summary
AppointmentUtil()
           
 
Method Summary
static ArrayList<Appointment> filterListByDate(ArrayList<Appointment> fullList, Date startDate)
          Filters a list of appointments and returns only appointments with a start date equal to the date provided.
static ArrayList<Appointment> filterListByDateRange(ArrayList<Appointment> fullList, Date date, int days)
           
static boolean rangeContains(Appointment appt, Date date)
           
static boolean rangeContains(Appointment appointment, Date rangeStart, Date rangeEnd)
          Indicates whether the specified appointment falls within the date range defined by rangeStart and rangeEnd.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppointmentUtil

public AppointmentUtil()
Method Detail

filterListByDateRange

public static ArrayList<Appointment> filterListByDateRange(ArrayList<Appointment> fullList,
                                                           Date date,
                                                           int days)

rangeContains

public static boolean rangeContains(Appointment appt,
                                    Date date)

rangeContains

public static boolean rangeContains(Appointment appointment,
                                    Date rangeStart,
                                    Date rangeEnd)
Indicates whether the specified appointment falls within the date range defined by rangeStart and rangeEnd.

Parameters:
appointment - The appointment to test
rangeStart - The range lower limit
rangeEnd - The range upper limit
Returns:
true if the appointment's date falls within the range, false otherwise.

filterListByDate

public static ArrayList<Appointment> filterListByDate(ArrayList<Appointment> fullList,
                                                      Date startDate)
Filters a list of appointments and returns only appointments with a start date equal to the date provided. FYI - I hate everything about this method and am pissed off I have to use it. May be able to avoid it in the future

Parameters:
fullList - A full set of Appointments, that will be filtered with the above described rule
startDate - The start date
Returns:
A list with all appointments whose start date is on or after the passed startDate


Copyright © 2012. All Rights Reserved.