Class Appointment
java.lang.Object
cz.cuni.kubinja.hospitalsystem.calendar.Appointment
- All Implemented Interfaces:
Exportable, Comparable<Appointment>
Appointment of patient and doctor in specific time and length.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal StringName of the department in which the appointment is taking placefinal intIdentification number of the doctor connected with this appointment.final LocalDateTimeEnding time of the appointmentfinal intIdentification number of appointmentstatic final intMinimum length of the displayed department namefinal intIdentification number of the patient connected with this appointment.final LocalDateTimeStarting time of the appointment -
Constructor Summary
ConstructorsConstructorDescriptionAppointment(int id, int patientId, int DoctorId, String department, LocalDateTime startTime, LocalDateTime endTime) Creates new appointment.Appointment(int id, Patient patient, Doctor doctor, LocalDateTime startTime, LocalDateTime endTime) Creates new appointment.Appointment(ResultSet result) Creates appointment from SQL result set. -
Method Summary
Modifier and TypeMethodDescriptionintCompares two appointments based on starting and ending time and id.export()Text format that will be used for exporting object.getStringForPart(Parts part) Returns info about appointment for the calendar diagram based on provided required part.booleaninConflict(LocalDateTime start, LocalDateTime end) Decided whether the time interval is in conflict, if the overlap.toString()
-
Field Details
-
id
public final int idIdentification number of appointment -
patientId
public final int patientIdIdentification number of the patient connected with this appointment. -
doctorId
public final int doctorIdIdentification number of the doctor connected with this appointment. -
department
Name of the department in which the appointment is taking place -
startTime
Starting time of the appointment -
endTime
Ending time of the appointment -
minimumDepartmentDisplayNameLength
public static final int minimumDepartmentDisplayNameLengthMinimum length of the displayed department name- See Also:
-
-
Constructor Details
-
Appointment
public Appointment(int id, int patientId, int DoctorId, String department, LocalDateTime startTime, LocalDateTime endTime) Creates new appointment.- Parameters:
id- Identifier of appointment.patientId- Patients identifier.DoctorId- Doctors identifier.department- Department in which the appointment is taking place.startTime- Starting time of the appointment.endTime- Ending time of the appointment.
-
Appointment
public Appointment(int id, Patient patient, Doctor doctor, LocalDateTime startTime, LocalDateTime endTime) Creates new appointment.- Parameters:
id- Identifier of appointment.patient- Patient connected to the appointment.doctor- Doctor connected to the appointment.startTime- Starting time of the appointment.endTime- Ending time of the appointment.
-
Appointment
Creates appointment from SQL result set.- Parameters:
result- SQL result set containing data for appointment creation.- Throws:
SQLException- Error connected with the invalid columns in result set or failure of retrieving data from result set.
-
-
Method Details
-
compareTo
Compares two appointments based on starting and ending time and id.- Specified by:
compareToin interfaceComparable<Appointment>- Parameters:
o- Other appointment.- Returns:
- Integer which denotes whether this appointment is smaller, bigger or equal then the other one.
-
getStringForPart
-
inConflict
Decided whether the time interval is in conflict, if the overlap.- Parameters:
start- Starting time of the interval.end- Ending time of the interval.- Returns:
- Whether the time interval is overlapping with the appointment.
-
export
Description copied from interface:ExportableText format that will be used for exporting object.- Specified by:
exportin interfaceExportable- Returns:
- text that will be used for exporting object.
-
toString
-