Class NamedTimer

java.lang.Object
  extended by Timer
      extended by NamedTimer

public class NamedTimer
extends Timer

A countdown timer with a name as well as minutes and seconds. The timer does not go less than zero.


Constructor Summary
NamedTimer(java.lang.String name)
          construct a NamedTimer with a String name and default time
NamedTimer(java.lang.String name, int minutes)
          construct a NamedTimer with a String name as well as minutes (value should be positive)
NamedTimer(java.lang.String name, int minutes, int seconds)
          construct a NamedTimer with a String name as well as minutes and seconds of timer (combined value should be positive)
 
Method Summary
 java.lang.String getName()
          get the name of the NamedTimer
 void setName(java.lang.String name)
          set the name of the NamedTimer
 java.lang.String toString()
          builds a string of the timer's value in name > time form
 
Methods inherited from class Timer
outOfTime, set, set, set, subtract
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedTimer

public NamedTimer(java.lang.String name,
                  int minutes,
                  int seconds)
construct a NamedTimer with a String name as well as minutes and seconds of timer (combined value should be positive)

Parameters:
name - String name for newly constructed timer
minutes - number of minutes on newly constructed timer
seconds - number of seconds on newly constructed timer

NamedTimer

public NamedTimer(java.lang.String name,
                  int minutes)
construct a NamedTimer with a String name as well as minutes (value should be positive)

Parameters:
name - String name for newly constructed timer
minutes - number of minutes on newly constructed timer

NamedTimer

public NamedTimer(java.lang.String name)
construct a NamedTimer with a String name and default time

Parameters:
name - String name for newly constructed timer
Method Detail

setName

public void setName(java.lang.String name)
set the name of the NamedTimer

Parameters:
name - String name of the timer

getName

public java.lang.String getName()
get the name of the NamedTimer

Returns:
String name of the timer

toString

public java.lang.String toString()
builds a string of the timer's value in name > time form

Overrides:
toString in class Timer
Returns:
a string of the timer's value in name > time form