public class MockScheduler extends Object implements Scheduler
| Constructor and Description |
|---|
MockScheduler() |
MockScheduler(MockTimer timer) |
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrentTime()
This returns the current time for the scheduler
|
Map<Long,List<ReadyRunnable>> |
getEntries() |
int |
getEntryCount() |
long |
getNextTime() |
long |
getNumTasksExecuted()
Returns the total number of scheduled tasks (ReadyRunnables) that have
been executed since the scheduler was initialized.
|
int |
getStatus()
Returns the current of this fiber.
|
long |
next() |
void |
pause()
Pauses the scheduler if it is current running.
|
void |
resume()
Resumes the scheduler if it has been paused.
|
void |
schedule(long interval,
ReadyRunnable schedule)
schedule
|
void |
start()
Starts the fiber.
|
void |
stop()
Stops the fiber.
|
long |
tick(int step) |
public MockScheduler()
public MockScheduler(MockTimer timer)
public void schedule(long interval,
ReadyRunnable schedule)
Schedulerschedule
This method is used to schedule a ready runnable in the system. The interval is used as the key for determining which queue to add the runnable.schedule in interface Schedulerschedule in interface ScheduleTimerinterval - a long.schedule - a ReadyRunnable object.public int getEntryCount()
public Map<Long,List<ReadyRunnable>> getEntries()
public long getNextTime()
public long next()
public long tick(int step)
public long getCurrentTime()
SchedulergetCurrentTime in interface SchedulergetCurrentTime in interface Timerpublic void start()
Schedulerpublic void stop()
Schedulerpublic void pause()
Schedulerpublic void resume()
Schedulerpublic int getStatus()
Schedulerpublic long getNumTasksExecuted()
SchedulergetNumTasksExecuted in interface SchedulerCopyright © 2022. All rights reserved.