fr.paris.lutece.plugins.appointment.business.calendar
Class AppointmentSlot

java.lang.Object
  extended by fr.paris.lutece.plugins.appointment.business.calendar.AppointmentSlot
All Implemented Interfaces:
Serializable, Comparable<AppointmentSlot>

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

Slot for an appointment in a day. The slot may have 3 states : free, partially free or occupied.

See Also:
Serialized Form

Constructor Summary
AppointmentSlot()
           
 
Method Summary
 int compareTo(AppointmentSlot o)
          Compare a slot to another one.
 boolean equals(Object o)
          
 int getDayOfWeek()
          Get the number of the day in the week.
 int getEndingHour()
          Get the ending hour of this slot
 int getEndingMinute()
          Get the ending minute of this slot
 int getIdDay()
          Get the id of the day, or 0 if this slot is not associated with a day but only with a form
 int getIdForm()
          Get the id of the form
 int getIdSlot()
          Get the id of the slot
 boolean getIsEnabled()
          Check if this slot is enabled for appointments or not
 int getNbFreePlaces()
          Get the number of free places for this slot
 int getNbPlaces()
          Get the number of places for this slot
 int getStartingHour()
          Get the starting hour of this slot
 int getStartingMinute()
          Get the starting minute of this slot
 int hashCode()
          
 void setDayOfWeek(int nDayOfWeek)
          Set the day of the week
 void setEndingHour(int nEndingHour)
          Set the ending hour of this slot
 void setEndingMinute(int nEndingMinute)
          Set the ending minute of this slot
 void setIdDay(int nIdDay)
          Set the id of the day
 void setIdForm(int nIdForm)
          Set the id of the form
 void setIdSlot(int nIdSlot)
          Set the id of the slot
 void setIsEnabled(boolean bIsEnabled)
          Enable or disable this slot for appointments
 void setNbFreePlaces(int nNbFreePlaces)
          Set the number of free places for this slot
 void setNbPlaces(int nNbPlaces)
          Set the number of places for this slot
 void setStartingHour(int nStartingHour)
          Set the starting hour of this slot
 void setStartingMinute(int nStartingMinute)
          Set the starting minute of this slot
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppointmentSlot

public AppointmentSlot()
Method Detail

getIdSlot

public int getIdSlot()
Get the id of the slot

Returns:
The id of the slot

setIdSlot

public void setIdSlot(int nIdSlot)
Set the id of the slot

Parameters:
nIdSlot - The id of the slot

getIdForm

public int getIdForm()
Get the id of the form

Returns:
The id of the form

setIdForm

public void setIdForm(int nIdForm)
Set the id of the form

Parameters:
nIdForm - The id of the form

getIdDay

public int getIdDay()
Get the id of the day, or 0 if this slot is not associated with a day but only with a form

Returns:
The of the day

setIdDay

public void setIdDay(int nIdDay)
Set the id of the day

Parameters:
nIdDay - The of the day, or 0 if this slot is not associated with a day but only with a form

getDayOfWeek

public int getDayOfWeek()
Get the number of the day in the week.

Returns:
The number of the day in the week. Returns 1 for Monday, 2 for Tuesday, ..., 7 for Sunday.

setDayOfWeek

public void setDayOfWeek(int nDayOfWeek)
Set the day of the week

Parameters:
nDayOfWeek - The number of the day in the week : 1 for Monday, 2 for Tuesday, ..., 7 for Sunday.

getNbPlaces

public int getNbPlaces()
Get the number of places for this slot

Returns:
The number of places for this slot

setNbPlaces

public void setNbPlaces(int nNbPlaces)
Set the number of places for this slot

Parameters:
nNbPlaces - The number of places for this slot

getNbFreePlaces

public int getNbFreePlaces()
Get the number of free places for this slot

Returns:
The number of free places for this slot

setNbFreePlaces

public void setNbFreePlaces(int nNbFreePlaces)
Set the number of free places for this slot

Parameters:
nNbFreePlaces - The number of free places for this slot

getStartingHour

public int getStartingHour()
Get the starting hour of this slot

Returns:
The starting hour of this slot

setStartingHour

public void setStartingHour(int nStartingHour)
Set the starting hour of this slot

Parameters:
nStartingHour - The starting hour of this slot

getStartingMinute

public int getStartingMinute()
Get the starting minute of this slot

Returns:
The starting minute of this slot

setStartingMinute

public void setStartingMinute(int nStartingMinute)
Set the starting minute of this slot

Parameters:
nStartingMinute - The starting minute of this slot

getEndingHour

public int getEndingHour()
Get the ending hour of this slot

Returns:
The ending hour of this slot

setEndingHour

public void setEndingHour(int nEndingHour)
Set the ending hour of this slot

Parameters:
nEndingHour - The ending hour of this slot

getEndingMinute

public int getEndingMinute()
Get the ending minute of this slot

Returns:
The ending minute of this slot

setEndingMinute

public void setEndingMinute(int nEndingMinute)
Set the ending minute of this slot

Parameters:
nEndingMinute - The ending minute of this slot

getIsEnabled

public boolean getIsEnabled()
Check if this slot is enabled for appointments or not

Returns:
True if this slot is enabled, false otherwise

setIsEnabled

public void setIsEnabled(boolean bIsEnabled)
Enable or disable this slot for appointments

Parameters:
bIsEnabled - True to enable this slot for appointments, false otherwise

equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

compareTo

public int compareTo(AppointmentSlot o)
Compare a slot to another one. Slots are compared by theire staring hour, starting minute, ending hour, ending minute and day of week.

Specified by:
compareTo in interface Comparable<AppointmentSlot>
Parameters:
o - Slot to compare this slot to
Returns:
1 of the given slot is greater that the current one, -1 if the other slot is lower than the current one, 0 if they are equals


Copyright © 2014 Mairie de Paris. All Rights Reserved.