/** * A countdown timer with a name as well as minutes and seconds. * The timer does not go less than zero. * @author Beth Katz */ public class NamedTimer extends Timer { /** construct a NamedTimer with a String name as well as minutes and seconds of timer (combined value should be positive) @param name String name for newly constructed timer @param minutes number of minutes on newly constructed timer @param seconds number of seconds on newly constructed timer */ public NamedTimer(String name, int minutes, int seconds) { super(minutes, seconds); setName(name); } /** construct a NamedTimer with a String name as well as minutes (value should be positive) @param name String name for newly constructed timer @param minutes number of minutes on newly constructed timer */ public NamedTimer(String name, int minutes) { super(minutes); setName(name); } /** construct a NamedTimer with a String name and default time @param name String name for newly constructed timer */ public NamedTimer(String name) { super( ); setName(name); } /** set the name of the NamedTimer @param name String name of the timer */ public void setName(String name) { theName = name; } /** get the name of the NamedTimer @return String name of the timer */ public String getName( ) { return theName; } /** builds a string of the timer's value in name > time form @return a string of the timer's value in name > time form */ public String toString( ) { return theName + " > " + super.toString( ); } private String theName; }