coins.driver
クラス StopWatch

java.lang.Object
  |
  +--coins.driver.StopWatch

public class StopWatch
extends java.lang.Object

A stop-watch.
This stop-watch is not moving when created, and starts when its start button is pushed. Its hand keeps moving until the stop button is pushd. You can read the time ever accumulated by this stop-watch, by mili-second order, whether it is moving or not. After the stop-watch is started and stopped, it can be restarted by pushing its start button again.


フィールドの概要
(パッケージプライベート)  long cumulativeMiliSeconds
           
(パッケージプライベート)  boolean moving
           
(パッケージプライベート)  java.util.Date startedTime
           
(パッケージプライベート)  java.util.Date stoppedTime
           
 
コンストラクタの概要
StopWatch()
          Creates a new stop-watch, whose hand is heading zero mili-second and not moving.
 
メソッドの概要
 boolean isMoving()
          Tests if this stop-watch is moving or not.
 long read()
          Reads this stop-watch, whether it is moving or not.
 long reset()
          Resets this stop-watch.
 java.util.Date start()
          Starts moving this stop-watch.
 java.util.Date stop()
          Stops moving this stop-watch.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

startedTime

java.util.Date startedTime

stoppedTime

java.util.Date stoppedTime

cumulativeMiliSeconds

long cumulativeMiliSeconds

moving

boolean moving
コンストラクタの詳細

StopWatch

public StopWatch()
Creates a new stop-watch, whose hand is heading zero mili-second and not moving.

メソッドの詳細

start

public java.util.Date start()
Starts moving this stop-watch.

戻り値:
The time this stop-watch was started, if it was already moving. null, otherwise.

stop

public java.util.Date stop()
Stops moving this stop-watch.

戻り値:
The time this stop-watch was stopped, if it was already stopped. null, otherwise.

read

public long read()
Reads this stop-watch, whether it is moving or not.

戻り値:
the mili-seconds ever accumulated by this stop-watch.

isMoving

public boolean isMoving()
Tests if this stop-watch is moving or not.

戻り値:
true if it is moving. false, otherwise.

reset

public long reset()
Resets this stop-watch. The hand goes back to zero mili-second and stops moving regardless of the current status.

戻り値:
the cumulative mili-seconds before resetting.