001package edu.pdx.cs410J;
002
003import java.io.Serializable;
004import java.util.Collection;
005
006/**
007 * This abstract class represents a customer's phone bill that
008 * consists of multiple phone calls.
009 *
010 * @author David Whitlock
011 */
012public abstract class AbstractPhoneBill<T extends AbstractPhoneCall> implements Serializable {
013
014  /**
015   * Returns the name of the customer whose phone bill this is
016   */
017  public abstract String getCustomer();
018
019  /**
020   * Adds a phone call to this phone bill
021   */
022  public abstract void addPhoneCall(T call);
023
024  /**
025   * Returns all of the phone calls (as instances of {@link
026   * AbstractPhoneCall}) in this phone bill
027   */
028  public abstract Collection<T> getPhoneCalls();
029
030  /**
031   * Returns a brief textual description of this phone bill
032   */
033  public final String toString() {
034    return this.getCustomer() + "'s phone bill with " +
035      this.getPhoneCalls().size() + " phone calls";
036  }
037
038}