com.std.model.appointment
Class AppointmentSet

java.lang.Object
extended by com.std.model.appointment.AppointmentSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Appointment>, java.util.Collection<Appointment>, java.util.NavigableSet<Appointment>, java.util.Set<Appointment>, java.util.SortedSet<Appointment>

public class AppointmentSet
extends java.lang.Object
implements java.util.NavigableSet<Appointment>, java.io.Serializable

implements the Set interface for Appointments and provides helper functions optimized for searching by startDate and endDate ranges

Author:
xxx
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
           
 
Constructor Summary
AppointmentSet()
          creates an empty AppointmentSet
 
Method Summary
 boolean add(Appointment e)
           
 boolean addAll(java.util.Collection<? extends Appointment> c)
           
 void appointmentChanged(Appointment appt)
          notifies our listeners when an appointment has been changed.
 void apptSetChanged(ObservableTreeSet<?> set, java.lang.Object o)
          notifies our listeners when the set has been changed.
 Appointment ceiling(Appointment e)
           
 void clear()
           
 java.util.Comparator<? super Appointment> comparator()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
 java.util.Iterator<Appointment> descendingIterator()
           
 java.util.NavigableSet<Appointment> descendingSet()
           
 Appointment first()
           
 Appointment floor(Appointment e)
           
 AppointmentSet getRange(DateRange dateRange)
           
 java.util.SortedSet<Appointment> headSet(Appointment toElement)
           
 java.util.NavigableSet<Appointment> headSet(Appointment toElement, boolean inclusive)
           
 Appointment higher(Appointment e)
           
 boolean isEmpty()
           
 java.util.Iterator<Appointment> iterator()
           
 Appointment last()
           
 Appointment lower(Appointment e)
           
 ObservableEvent onAppointmentChanged()
           
 ObservableEvent onChanged()
           
 Appointment pollFirst()
           
 Appointment pollLast()
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 boolean retainAll(java.util.Collection<?> c)
           
 int size()
           
 java.util.SortedSet<Appointment> subSet(Appointment fromElement, Appointment toElement)
           
 java.util.NavigableSet<Appointment> subSet(Appointment fromElement, boolean fromInclusive, Appointment toElement, boolean toInclusive)
           
 java.util.SortedSet<Appointment> tailSet(Appointment fromElement)
           
 java.util.NavigableSet<Appointment> tailSet(Appointment fromElement, boolean inclusive)
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
equals, hashCode
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

AppointmentSet

public AppointmentSet()
creates an empty AppointmentSet

Method Detail

add

public boolean add(Appointment e)
Specified by:
add in interface java.util.Collection<Appointment>
Specified by:
add in interface java.util.Set<Appointment>

addAll

public boolean addAll(java.util.Collection<? extends Appointment> c)
Specified by:
addAll in interface java.util.Collection<Appointment>
Specified by:
addAll in interface java.util.Set<Appointment>

appointmentChanged

public void appointmentChanged(Appointment appt)
notifies our listeners when an appointment has been changed.

Parameters:
appt - appointment that has been changed

apptSetChanged

public void apptSetChanged(ObservableTreeSet<?> set,
java.lang.Object o)
notifies our listeners when the set has been changed.

Parameters:
set - set taht has been changed
o - element that has been added or removed

ceiling

public Appointment ceiling(Appointment e)
Specified by:
ceiling in interface java.util.NavigableSet<Appointment>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<Appointment>
Specified by:
clear in interface java.util.Set<Appointment>

comparator

public java.util.Comparator<? super Appointment> comparator()
Specified by:
comparator in interface java.util.SortedSet<Appointment>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<Appointment>
Specified by:
contains in interface java.util.Set<Appointment>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<Appointment>
Specified by:
containsAll in interface java.util.Set<Appointment>

descendingIterator

public java.util.Iterator<Appointment> descendingIterator()
Specified by:
descendingIterator in interface java.util.NavigableSet<Appointment>

descendingSet

public java.util.NavigableSet<Appointment> descendingSet()
Specified by:
descendingSet in interface java.util.NavigableSet<Appointment>

first

public Appointment first()
Specified by:
first in interface java.util.SortedSet<Appointment>

floor

public Appointment floor(Appointment e)
Specified by:
floor in interface java.util.NavigableSet<Appointment>

getRange

public AppointmentSet getRange(DateRange dateRange)
Parameters:
dateRange - the bounding range of the appointment set
Returns:
a subset of this appointment set containing any appointment that falls between startDate and endDate

headSet

public java.util.SortedSet<Appointment> headSet(Appointment toElement)
Specified by:
headSet in interface java.util.NavigableSet<Appointment>
Specified by:
headSet in interface java.util.SortedSet<Appointment>

headSet

public java.util.NavigableSet<Appointment> headSet(Appointment toElement,
boolean inclusive)
Specified by:
headSet in interface java.util.NavigableSet<Appointment>

higher

public Appointment higher(Appointment e)
Specified by:
higher in interface java.util.NavigableSet<Appointment>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<Appointment>
Specified by:
isEmpty in interface java.util.Set<Appointment>

iterator

public java.util.Iterator<Appointment> iterator()
Specified by:
iterator in interface java.lang.Iterable<Appointment>
Specified by:
iterator in interface java.util.Collection<Appointment>
Specified by:
iterator in interface java.util.NavigableSet<Appointment>
Specified by:
iterator in interface java.util.Set<Appointment>

last

public Appointment last()
Specified by:
last in interface java.util.SortedSet<Appointment>

lower

public Appointment lower(Appointment e)
Specified by:
lower in interface java.util.NavigableSet<Appointment>

onAppointmentChanged

public ObservableEvent onAppointmentChanged()
Returns:
the observable event that will send out notifications when any of the elements have changed.

onChanged

public ObservableEvent onChanged()
Returns:
the observable event that will send out notifications when the set has changed.

pollFirst

public Appointment pollFirst()
Specified by:
pollFirst in interface java.util.NavigableSet<Appointment>

pollLast

public Appointment pollLast()
Specified by:
pollLast in interface java.util.NavigableSet<Appointment>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<Appointment>
Specified by:
remove in interface java.util.Set<Appointment>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<Appointment>
Specified by:
removeAll in interface java.util.Set<Appointment>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<Appointment>
Specified by:
retainAll in interface java.util.Set<Appointment>

size

public int size()
Specified by:
size in interface java.util.Collection<Appointment>
Specified by:
size in interface java.util.Set<Appointment>

subSet

public java.util.SortedSet<Appointment> subSet(Appointment fromElement,
Appointment toElement)
Specified by:
subSet in interface java.util.NavigableSet<Appointment>
Specified by:
subSet in interface java.util.SortedSet<Appointment>

subSet

public java.util.NavigableSet<Appointment> subSet(Appointment fromElement,
boolean fromInclusive,
Appointment toElement,
boolean toInclusive)
Specified by:
subSet in interface java.util.NavigableSet<Appointment>

tailSet

public java.util.SortedSet<Appointment> tailSet(Appointment fromElement)
Specified by:
tailSet in interface java.util.NavigableSet<Appointment>
Specified by:
tailSet in interface java.util.SortedSet<Appointment>

tailSet

public java.util.NavigableSet<Appointment> tailSet(Appointment fromElement,
boolean inclusive)
Specified by:
tailSet in interface java.util.NavigableSet<Appointment>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<Appointment>
Specified by:
toArray in interface java.util.Set<Appointment>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<Appointment>
Specified by:
toArray in interface java.util.Set<Appointment>