|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectTimer
public class Timer
A countdown timer with minutes and seconds. The timer does not go less than zero.
| Constructor Summary | |
|---|---|
Timer()
construct a timer with no initial value; timer set to zero |
|
Timer(int minutes)
construct a timer with a positive number of minutes |
|
Timer(int minutes,
int seconds)
construct a timer with minutes and seconds of timer (combined value should be positive) |
|
| Method Summary | |
|---|---|
boolean |
outOfTime()
returns whether timer has run out of time |
void |
set()
sets timer to zero |
void |
set(int minutes)
sets minutes of timer (value should be positive) |
void |
set(int minutes,
int seconds)
sets minutes and seconds of timer (combined value should be positive) |
void |
subtract(int minutes,
int seconds)
subtracts minutes and seconds from timer; timer should not fall below zero |
java.lang.String |
toString()
builds a string of the timer's value in minutes:seconds form |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Timer(int minutes,
int seconds)
minutes - number of minutes on newly constructed timerseconds - number of seconds on newly constructed timerpublic Timer(int minutes)
minutes - number of minutes on newly constructed timerpublic Timer()
| Method Detail |
|---|
public void set(int minutes,
int seconds)
minutes - number of minutesseconds - number of secondspublic void set(int minutes)
minutes - number of minutespublic void set()
public java.lang.String toString()
toString in class java.lang.Object
public void subtract(int minutes,
int seconds)
minutes - number of minutes to subtractseconds - number of seconds to subtractpublic boolean outOfTime()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||