public interface Clock
Modifier and Type | Method and Description |
---|---|
void |
addListener(ClockListener listener)
Adds a listener to the clock.
|
long |
currentTimeMillis()
Returns the current time in (virtual) milliseconds.
|
long |
getElapsedTime()
gets the elapsed time in (virtual) milliseconds from the start date.
|
int |
getFactor()
Returns the clock factor.
|
String |
getId()
Returns the identifier of the clock.
|
long |
getStartDate()
Returns the clock start date.
|
boolean |
isPaused()
Returns true if the clock is paused, false otherwise
|
void |
pause()
Pauses the (virtual) time flowing.
|
void |
pause(boolean notify)
Pauses the (virtual) time flowing.
|
void |
removeListener(ClockListener listener)
Removes a listener from the clock.
|
void |
reset()
Sets the elapsed time to 0 and pauses the (virtual) time flowing.
|
void |
resume()
Resumes the (virtual) time flowing.
|
void |
resume(boolean notify)
Resumes the (virtual) time flowing.
|
void |
setFactor(int factor)
Set the clock factor (speed of virtual time)
|
void |
setStartDate(long startDate)
Sets the start date of the clock.
|
String getId()
long currentTimeMillis()
void setStartDate(long startDate)
startDate
- the new start date.void setFactor(int factor)
factor
- the new factor.long getElapsedTime()
void pause()
void resume()
void pause(boolean notify)
notify
- True to notify listeners, false if not.void resume(boolean notify)
notify
- True to notify listeners, false if not.void reset()
int getFactor()
long getStartDate()
boolean isPaused()
void addListener(ClockListener listener)
listener
- The listener to be added.void removeListener(ClockListener listener)
listener
- The listener to be removed.Copyright © 2012-2013 ADELE Research Group. All Rights Reserved.