public class ForwardingClock extends Object implements InternalClock, Closeable
InternalClock.TimeReachedEvent, InternalClock.TimeReachedJob
Constructor and Description |
---|
ForwardingClock(InternalClock _clock) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
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 ForwardingClock(InternalClock _clock)
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
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.