/**
  * Loads the object from an object input stream
  *
  * @param istream the object stream to be reading from
  * @throws ClassNotFoundException if there is a casting error
  * @throws IOException an I/O exception of some sort has occurred
  */
 private void readObject(ObjectInputStream istream) throws ClassNotFoundException, IOException {
   internalSetTitle((String) istream.readObject());
   internalSetDescription((String) istream.readObject());
   internalSetLocation((String) istream.readObject());
   internalSetDuration(istream.readLong());
   internalSetPattern((RecurrencePattern) istream.readObject());
 }
 /**
  * Sets all the fields of the appointment, and notifies observers if a change has taken place.
  *
  * @param apptTmple the new appointment fields
  */
 public void setFields(AppointmentTemplateInterface apptTmpl) {
   internalSetTitle(apptTmpl.getTitle());
   internalSetDescription(apptTmpl.getDescription());
   internalSetLocation(apptTmpl.getLocation());
   internalSetDuration(apptTmpl.getDuration());
   internalSetPattern(apptTmpl.getPattern());
   this.notifyObservers();
 }
  /**
   * creates a new AppointmentTemplate
   *
   * @param title Title of the appointment.
   * @param description Description of the appointment.
   * @param location Location of the appointment.
   * @param duration Duration of the appointment in milliseconds.
   */
  public AppointmentTemplate(String title, String description, String location, long duration) {
    super();
    internalSetTitle(title);
    internalSetDescription(description);
    internalSetLocation(location);
    internalSetDuration(duration);
    recPattern = null;

    this.notifyObservers();
  }
 /**
  * Sets the description of the appointment, and notifies observers if a change has taken place.
  *
  * @param description the new description for the appointment
  * @throws NullPointerException if description is null
  */
 public void setDescription(String description) {
   internalSetDescription(description);
   this.notifyObservers();
 }