///****************************************************************** // Appointment.java Author: Anders Keldsen 14/10-2002 // // Representation of an appointment. //****************************************************************** public class Appointment { //Instance data private Time startTime, endTime; private String description; //Constructor for the Appointment class public Appointment(Time startTime, Time endTime, String description) { this.startTime = startTime; this.endTime = endTime; this.description = description; } //Prolong the appointment by "min" minutes public void prolong(int min) { endTime.passtime(min); } //Postpone the appointment by "min" minutes public void postpone(int min) { startTime.passtime(min); endTime.passtime(min); } public String toString() { return "Appointment about " +description+ ". Starts at " +startTime+ " and ends at " +endTime; } }