com.std.model.appointment
Class StatefulAppointment

java.lang.Object
extended by com.std.util.Stateful<Appointment>
extended by com.std.model.appointment.StatefulAppointment

public class StatefulAppointment
extends Stateful<Appointment>

keeps track of a single appointment, and provides utilities of changing it in relation of it's parent set

Author:
xxx

Constructor Summary
StatefulAppointment(Stateful<AppointmentSet> targetSet)
          creates a new StatefulAppointment object with the passed target set, and defaulting to a null target
 
Method Summary
 void apptSetChanged(AppointmentSet apptSet, Appointment appt)
          resets the target when the target is removed from the set
 void apptSetReplaced()
          resets the target when the target set is changed
 void firstAppointment()
          sets the target to the first chronological appointment
 void lastAppointment()
          sets the target to the last chronological appointment
 void nextAppointment()
          advances the target to the next chronological appointment or, if the target is null, sets it to the first chronological appointment
 void previousAppointment()
          advances the target to the previous chronological appointment or, if the target is null, sets it to the last chronological appointment
 void setTarget(Appointment target)
          sets the target appointment
 
Methods inherited from class com.std.util.Stateful
getTarget, onChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulAppointment

public StatefulAppointment(Stateful<AppointmentSet> targetSet)
creates a new StatefulAppointment object with the passed target set, and defaulting to a null target

Parameters:
targetSet - the set to derive all targets from
Method Detail

apptSetReplaced

public void apptSetReplaced()
resets the target when the target set is changed


apptSetChanged

public void apptSetChanged(AppointmentSet apptSet,
Appointment appt)
resets the target when the target is removed from the set


firstAppointment

public void firstAppointment()
sets the target to the first chronological appointment


lastAppointment

public void lastAppointment()
sets the target to the last chronological appointment


nextAppointment

public void nextAppointment()
advances the target to the next chronological appointment or, if the target is null, sets it to the first chronological appointment


previousAppointment

public void previousAppointment()
advances the target to the previous chronological appointment or, if the target is null, sets it to the last chronological appointment


setTarget

public void setTarget(Appointment target)
sets the target appointment

Overrides:
setTarget in class Stateful<Appointment>
Parameters:
target - the new target reference
Throws:
java.lang.IllegalArgumentException - if the intended target is null or not a member of the parent set