| Constructor and Description |
|---|
AdjustableClock()
Constructor that sets the initial time to the current time.
|
AdjustableClock(long initialTime)
Constructor that sets the current time to the supplied time.
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustTime(long adjustment)
Adjust the current time.
|
long |
getTimeMillis()
Return the current time, in milliseconds.
|
void |
setTimeMillis(long currentTime)
Sets the current time, in milliseconds.
|
public AdjustableClock()
public AdjustableClock(long initialTime)
initialTime - the time, in milliseconds since midnight,
January 1, 1970 UTCpublic void setTimeMillis(long currentTime)
currentTime - the time, in milliseconds since midnight,
January 1, 1970 UTCpublic void adjustTime(long adjustment)
adjustment is positive,
the clock advances. If the adjustment is negative, you
go back in time.adjustment - the adjustment, in milliseconds.public long getTimeMillis()
getTimeMillis in interface Clock