package project2; import java.awt.Color; /** Methods by which a class might wish to identify information about itself. * * In the method descriptions, "short string" indicates something that would be * suitable to display in a limited amount of space, such as on a small label. Generally * these strings should be shorter than 20 characters in length, should not contain * linefeeds, and should not have leading or trailing whitespace. * A "long string" in the descriptions below means a string which may contain * linefeeds, but should not contain leading or trailing whitespace. * There is no requirement that a "long string" be any longer than a "short string". * There is no requirement that the long and short versions of a particular piece * of information be different. Strings may be empty, but should not be null. * They are intended to make it easier for * client classes to process the strings by knowing better what to expect. * Concrete classes may choose to enforce or ignore these or other restrictions. * The methods are generally not static, to allow for the possibility that different * objects of the same type may wish to expose different public identifying infomration. */ public interface IPublicInformation { /** Tells a small amount of author information. * @return a "short string" identifying the author(s) * of the class. * **** IF YOU DO NOT WISH TO BE PUBLICALLY IDENTIFIED, return a pseudonym or * code name. */ public String getAuthor(); /** Gives a URL to an image representing this class. * @return a string which is a full URL to a .jpg or .gif file. The * image is expected to in some way stand for or depict the class. It * is acceptable to return null. */ public String getImageURLString(); /** Return a "long string" describing the object or how to use it. */ public String getInstructions(); /** Tell the name of this class (or better, what this class represents). * @return A short string with the name of the oracle; there should be * no leading or trailing whitespace. The same value should be returned * for all objects of this type (a "static final" instance variable would help to enforce this). * */ public String getName(); /** Return a short string identifying this object. The object name should * be unique for each object instantiated. */ public String getObjectName(); /** Return a "long string" describing this object. The description might * be the same for all objects of the type. */ public String getObjectDescription(); /** Return a preferred color for the object. Colors might be used by * clients to set a background color, a border color, etc. * @return A Color, or null if there is no preferred color. */ public Color getColor(); //end IPublicInformation }