stopwatch
Class Stopwatch

java.lang.Object
  extended by stopwatch.Stopwatch
All Implemented Interfaces:
java.lang.Runnable

public class Stopwatch
extends java.lang.Object
implements java.lang.Runnable


Field Summary
static int FR_MAX
           
private  int fract
           
private  java.lang.Thread fractThread
           
private  boolean fractThreadSuspended
           
private  int hr
           
static int HR_MAX
           
private  java.lang.Thread hrThread
           
private  boolean hrThreadSuspended
           
static int Interval
           
private  int min
           
static int MIN_MAX
           
private  java.lang.Thread minThread
           
private  boolean minThreadSuspended
           
private  int myState
           
static int PAUSE
           
static int PAUSED
           
static int READY
           
static int RESET
           
static int RESUME
           
static int RUNNING
           
private  int sec
           
static int SEC_MAX
           
private  java.lang.Thread secThread
           
private  boolean secThreadSuspended
           
static int START
           
static int STOP
           
static int STOPPED
           
private  java.lang.Thread tmrThread
           
private  boolean tmrThreadSuspended
           
 
Constructor Summary
Stopwatch()
           
 
Method Summary
 void dispatch(int e)
           
private  void initStopwatch()
           
private  void initThreads()
           
private  void paused(int e)
           
private  void ready(int e)
           
private  void resumeFractThread()
           
private  void resumeHrThread()
           
private  void resumeMinThread()
           
private  void resumeSecThread()
           
 void reWriteAll()
           
 void reWriteFract()
           
 void reWriteHr()
           
 void reWriteMin()
           
 void reWriteSec()
           
 void run()
           
private  void runFractThread(java.lang.Thread thisThread)
           
private  void runHrThread(java.lang.Thread thisThread)
           
private  void runMinThread(java.lang.Thread thisThread)
           
private  void running(int e)
           
private  void runSecThread(java.lang.Thread thisThread)
           
private  void runtmrThread(java.lang.Thread thisThread)
           
private  void stopped(int e)
           
private  void tran(int target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

START

public static final int START
See Also:
Constant Field Values

STOP

public static final int STOP
See Also:
Constant Field Values

PAUSE

public static final int PAUSE
See Also:
Constant Field Values

RESUME

public static final int RESUME
See Also:
Constant Field Values

RESET

public static final int RESET
See Also:
Constant Field Values

READY

public static final int READY
See Also:
Constant Field Values

RUNNING

public static final int RUNNING
See Also:
Constant Field Values

PAUSED

public static final int PAUSED
See Also:
Constant Field Values

STOPPED

public static final int STOPPED
See Also:
Constant Field Values

Interval

public static final int Interval
See Also:
Constant Field Values

FR_MAX

public static final int FR_MAX
See Also:
Constant Field Values

SEC_MAX

public static final int SEC_MAX
See Also:
Constant Field Values

MIN_MAX

public static final int MIN_MAX
See Also:
Constant Field Values

HR_MAX

public static final int HR_MAX
See Also:
Constant Field Values

myState

private int myState

hr

private int hr

min

private int min

sec

private int sec

fract

private int fract

tmrThreadSuspended

private volatile boolean tmrThreadSuspended

secThreadSuspended

private volatile boolean secThreadSuspended

fractThreadSuspended

private volatile boolean fractThreadSuspended

minThreadSuspended

private volatile boolean minThreadSuspended

hrThreadSuspended

private volatile boolean hrThreadSuspended

tmrThread

private volatile java.lang.Thread tmrThread

fractThread

private volatile java.lang.Thread fractThread

secThread

private volatile java.lang.Thread secThread

minThread

private volatile java.lang.Thread minThread

hrThread

private volatile java.lang.Thread hrThread
Constructor Detail

Stopwatch

public Stopwatch()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

runtmrThread

private void runtmrThread(java.lang.Thread thisThread)

runFractThread

private void runFractThread(java.lang.Thread thisThread)

runSecThread

private void runSecThread(java.lang.Thread thisThread)

runMinThread

private void runMinThread(java.lang.Thread thisThread)

runHrThread

private void runHrThread(java.lang.Thread thisThread)

reWriteFract

public void reWriteFract()

reWriteSec

public void reWriteSec()

reWriteMin

public void reWriteMin()

reWriteHr

public void reWriteHr()

reWriteAll

public void reWriteAll()

resumeFractThread

private void resumeFractThread()

resumeSecThread

private void resumeSecThread()

resumeMinThread

private void resumeMinThread()

resumeHrThread

private void resumeHrThread()

initThreads

private void initThreads()

initStopwatch

private void initStopwatch()

tran

private void tran(int target)

dispatch

public void dispatch(int e)

ready

private void ready(int e)

running

private void running(int e)

paused

private void paused(int e)

stopped

private void stopped(int e)