001package edu.pdx.cs410J;
002
003import java.io.Serializable;
004import java.time.ZonedDateTime;
005import java.util.Date;
006
007/**
008 * This abstract class represents a phone call between a caller (the
009 * phone number of the person who originates the call) and callee (the
010 * phone number of the person whose receives the phone call).  Phone
011 * calls begin and end at given times.
012 *
013 * @author David Whitlock
014 */
015public abstract class AbstractPhoneCall implements Serializable {
016
017  /**
018   * Returns the phone number of the person who originated this phone
019   * call.
020   */
021  public abstract String getCaller();
022
023  /**
024   * Returns the phone number of the person who received this phone
025   * call.
026   */
027  public abstract String getCallee();
028
029  /**
030   * Returns the time that this phone call began as a {@link Date}.
031   */
032  public ZonedDateTime getBeginTime() {
033    return null;
034  }
035
036  /**
037   * Returns a textual representation of the time that this phone call
038   * began.
039   */
040  public abstract String getBeginTimeString();
041
042  /**
043   * Returns the time that this phone call was completed as a
044   * {@link Date}.
045   */
046  public ZonedDateTime getEndTime() {
047    return null;
048  }
049
050  /**
051   * Returns a textual representation of the time that this phone call
052   * was completed.
053   */
054  public abstract String getEndTimeString();
055
056  /**
057   * Returns a brief textual description of this phone call.
058   */
059  public final String toString() {
060    return "Phone call from " + this.getCaller() + " to " +
061      this.getCallee() + " from " + this.getBeginTimeString() + 
062      " to " + this.getEndTimeString();
063  }
064
065}