package genericity; /** * @mathmodel c : Colors, where Colors is the color of the pencil * @mathmodel s : int, where s is the length of the pencil * @constraint s > 0 */ public interface Pencil { /** * @return human-readable representation of as a string */ public String toString(); /** * @param newColor is a valid color * @alters this.c * @ensures this.c = newColor */ public void setColor(Colors newColor); /** * @param remove amount by which pencil will be shortened * @requires remove >= 0 * @alters this.s * @ensures remove < #s ==> s + remove = #s */ public void sharpen(int remove); }