Class XQ2Scheduler
java.lang.Object
|
+----Scheduler
|
+----XQ2Scheduler
- public class XQ2Scheduler
- extends Scheduler
-
XQ2Scheduler()
-
-
add(Job, int)
- Add a new job wanting service.
-
printQueue()
- For debugging: print the queue of waiting jobs
-
remove()
- Retrieve (and remove) the next job to be served.
-
reschedule(int)
- This method is called when there is a clock interrupt.
XQ2Scheduler
public XQ2Scheduler()
add
public boolean add(Job j,
int timeLeft)
- Add a new job wanting service.
The second argument is the amount of time remaining before the
job currently using the device will finish (-1 if the device is idle).
Return TRUE if this scheduler would like to preempt the current
job.
- Overrides:
- add in class Scheduler
remove
public Job remove()
- Retrieve (and remove) the next job to be served.
Return null if there is no such job.
- Overrides:
- remove in class Scheduler
reschedule
public boolean reschedule(int timeLeft)
- This method is called when there is a clock interrupt.
It returns true if there is a reason to stop the current process
and run another one instead.
The argument is the amount of time left until the current job
finishes service on the device.
It is ignored for RR scheduling (we preempt if and only if there
is some other job to run).
- Overrides:
- reschedule in class Scheduler
printQueue
public void printQueue()
- For debugging: print the queue of waiting jobs
- Overrides:
- printQueue in class Scheduler