Class gjt.Stopwatch
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gjt.Stopwatch

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----gjt.Stopwatch

public class Stopwatch
extends Thread
A Thread that acts as a stopwatch.

Stopwatch starts running when it is constructed, and may be reset by the reset() method. getHour(), getMinute(), getSecond(), and getMillisecond() are used to get the elapsed time since construction, or since the last reset.

toString() returns the elapsed time in the form of HH:MM:SS:mm, where HH == hours, MM == minutes, SS == seconds and mm == milliseconds.

Each Stopwatch may have a StopwatchClient associated with it. If the StopwatchClient is non-null, the StopwatchClients' tick() method is invoked every 50 milliseconds.

See Also:
StopwatchClient, Sequence, Sprite

Constructor Index

 o Stopwatch()
 o Stopwatch(StopwatchClient)

Method Index

 o elapsedTime()
 o getHour()
 o getMillisecond()
 o getMinute()
 o getSecond()
 o reset()
 o run()
 o toString()
 o update()

Constructors

 o Stopwatch
  public Stopwatch()
 o Stopwatch
  public Stopwatch(StopwatchClient client)

Methods

 o update
  public void update()
 o toString
  public String toString()
Overrides:
toString in class Thread
 o getHour
  public long getHour()
 o getMinute
  public long getMinute()
 o getSecond
  public long getSecond()
 o getMillisecond
  public long getMillisecond()
 o elapsedTime
  public long elapsedTime()
 o reset
  public void reset()
 o run
  public void run()
Overrides:
run in class Thread

All Packages  Class Hierarchy  This Package  Previous  Next  Index