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)
Scheduler
schedule
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 Scheduler
schedule
in interface ScheduleTimer
interval
- 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()
Scheduler
getCurrentTime
in interface Scheduler
getCurrentTime
in interface Timer
public void start()
Scheduler
public void stop()
Scheduler
public void pause()
Scheduler
public void resume()
Scheduler
public int getStatus()
Scheduler
public long getNumTasksExecuted()
Scheduler
getNumTasksExecuted
in interface Scheduler
Copyright © 2021. All rights reserved.