public class ClockDefaultImpl extends Object implements InternalClock
InternalClock.TimeReachedEvent, InternalClock.TimeReachedJob
Modifier and Type | Field and Description |
---|---|
static ClockDefaultImpl |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
InternalClock.TimeReachedJob |
createJob(InternalClock.TimeReachedEvent ev)
Creates a job object for the specified event callback.
|
void |
disableJob(InternalClock.TimeReachedJob j)
Disable the job clearing used resources.
|
boolean |
isJobSchedulable()
The clock is capable to execute code when a certain time is reached and before
the time advances further.
|
long |
millis()
Returns the milliseconds since epoch.
|
void |
schedule(InternalClock.TimeReachedJob j,
long _millis)
Schedules or reschedules the timer event job to be run at the
specified point in time.
|
void |
sleep(long _millis)
Wait for the specified amount of time in milliseconds.
|
public static final ClockDefaultImpl INSTANCE
public boolean isJobSchedulable()
InternalClock
isJobSchedulable
in interface InternalClock
public InternalClock.TimeReachedJob createJob(InternalClock.TimeReachedEvent ev)
InternalClock
createJob
in interface InternalClock
public void schedule(InternalClock.TimeReachedJob j, long _millis)
InternalClock
schedule
in interface InternalClock
public void disableJob(InternalClock.TimeReachedJob j)
InternalClock
disableJob
in interface InternalClock
public long millis()
InternalClock
InternalClock.sleep(long)
needs to be called to make time pass by and
make this method return an increased number.millis
in interface InternalClock
public void sleep(long _millis) throws InterruptedException
InternalClock
When using a simulated clock either this method or InternalClock.millis()
needs to be
called to make time pass and make InternalClock.millis()
return an increased number.
sleep
in interface InternalClock
InterruptedException
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.