org.commonreality.time.impl
Class BasicClock

java.lang.Object
  extended by org.commonreality.time.impl.BasicClock
All Implemented Interfaces:
IClock, ISetableClock
Direct Known Subclasses:
OwnedClock

public class BasicClock
extends java.lang.Object
implements IClock, ISetableClock

Author:
developer

Constructor Summary
BasicClock()
           
 
Method Summary
 void await(long maxWait)
          wait on the signal..
 double getTime()
           
 double setTime(double time)
          set the time and signal
 double waitForChange()
          wait for any change of time
 double waitForTime(double time)
          wait for this time to be reached, returning the current time
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicClock

public BasicClock()
Method Detail

getTime

public double getTime()
Specified by:
getTime in interface IClock
Returns:
the current time
See Also:
IClock.getTime()

waitForChange

public double waitForChange()
                     throws java.lang.InterruptedException
Description copied from interface: IClock
wait for any change of time

Specified by:
waitForChange in interface IClock
Throws:
java.lang.InterruptedException
See Also:
IClock.waitForChange()

waitForTime

public double waitForTime(double time)
                   throws java.lang.InterruptedException
Description copied from interface: IClock
wait for this time to be reached, returning the current time

Specified by:
waitForTime in interface IClock
Returns:
Throws:
java.lang.InterruptedException
See Also:
IClock.waitForTime(double)

await

public void await(long maxWait)
           throws java.lang.InterruptedException
wait on the signal..

Throws:
java.lang.InterruptedException

setTime

public double setTime(double time)
set the time and signal

Specified by:
setTime in interface ISetableClock
Parameters:
time -