001package edu.pdx.cs410J; 002 003import java.io.Serializable; 004import java.util.Collection; 005 006/** 007 * This class represents an appointment book that holds multiple 008 * appointments. Each appointment book has an owner. 009 * 010 * @author David Whitlock 011 */ 012public abstract class AbstractAppointmentBook<T extends AbstractAppointment> implements Serializable { 013 014 /** 015 * Returns the name of the owner of this appointment book. 016 */ 017 public abstract String getOwnerName(); 018 019 /** 020 * Returns all of the appointments in this appointment book as a 021 * collection of {@link AbstractAppointment}s. 022 */ 023 public abstract Collection<T> getAppointments(); 024 025 /** 026 * Adds an appointment to this appointment book 027 */ 028 public abstract void addAppointment(T appt); 029 030 /** 031 * Returns a brief textual description of this appointment book 032 */ 033 public final String toString() { 034 return this.getOwnerName() + "'s appointment book with " + 035 this.getAppointments().size() + " appointments"; 036 } 037}