/**
* PIMEntity is the abstract class for all items managed by the
* personal information manager.
*
* PIMEntities all have a priority (a string) and can convert
* themselves to a single string and from a string.
* @author Dave Hollinger
* @version 1.0
*/
public abstract class PIMEntity {
/**
* Priority is an arbitrary string (the manager decides what are
* legal values).
*/
String Priority;
/**
* The default constructor sets the priority to "normal"
*/
public PIMEntity() {
Priority = "normal";
}
/**
* alternate constructor that allows the priority to be set.
*
* @param priority the priority label to be associated with the object.
*/
public PIMEntity(String priority) {
Priority = priority;
}
/**
* Accessor method for getting the priority string.
*
* @return the current priority string
*/
public String getPriority() {
return Priority;
}
/**
* Sets the priority string
*
* @param p the new priority label (string).
*/
public void setPriority(String p) {
Priority = p;
}
/**
* Each PIMEntity needs to be able to set all state information
* (fields) from a single text string.
*/
abstract public void fromString(String s);
/** This is actually already defined by the super class
* Object, but redefined here as abstract to make sure
* that derived classes actually implement it
*/
abstract public String toString();
}