/** 
 * PIMEntity abstract class definition
 *
 * All PIMEntitys have:
 *      priority (a string)
 *      owner (a string)
 *      shared (a boolean)
 */

import java.io.*;

public abstract class PIMEntity implements Serializable {
  String Priority; 			// every kind of item has a priority
  String Owner;				// every item has an owner
  boolean Shared;		// is this a public or private item?

  /** default constructor sets priority to "Normal"
   * owner to "Nobody"
   * and share to true (the default is that the item is public)
   */
   
  PIMEntity() {
	Priority = "Normal";
	Owner = "Nobody";
	Shared = true;
  }


  /** can specify the priority, owner and sharing
   *
   */
  PIMEntity(String priority, String owner, boolean shared) {
	Priority =  priority;
	Owner = owner;
	Shared = shared;
  }


  /**
   * returns the current priority string
   */

  public String getPriority() {
	return Priority;
  }

  // method that changes the priority string
  public void setPriority(String p) {
	Priority = p;
  }

  /** accessor function for getting the owner
   */
  public String getOwner() {
	return Owner;
  }

  /** method that changes the owner
   */
  public void setOwner(String owner) {
	Owner = owner;
  }


  /** accessor function for getting the sharing flag
   */
  public boolean getShared() {
	return Shared;
  }

  /** set sharing policy for this item
   * true means the item is public. (false - it is not shared)
   */
  public void setShared(boolean shared) {
	Shared = shared;
  }

  /**
   * Base class toString returns information common to
   * all PIMEntitys formatted for printing.
   * (this is called by derived class toString methods)
   */

  public String toString() {
	return "Priority: " + Priority + "\n" +
	  "Owner: " + Owner + "\n" +
	  "Shared: " + (Shared?"Yes":"No") + "\n";
  }

}

