|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.pj.job.JobGenerator
public abstract class JobGenerator
Class JobGenerator is the abstract base class for an object that generates a group of Jobs.
Jobs are numbered from 0 to N−1, where N is the number of jobs in the group. A subclass must override the jobCount() method to return N. A subclass must override the createJob() method to create and return the job corresponding to a given job number. The job generator need not create all the jobs in the group, and it need not create them in any particular order.
Class JobGenerator provides the omit() method to omit generating certain job numbers. This is used for checkpointing. For further information, see class Runner.
| Constructor Summary | |
|---|---|
JobGenerator()
Construct a new job generator. |
|
| Method Summary | |
|---|---|
protected abstract Job |
createJob(int theJobNumber)
Create the job with the given job number. |
Iterator<Job> |
iterator()
Get an iterator for generating the jobs in the job group. |
protected abstract int |
jobCount()
Returns the number of jobs in the job group, N. |
void |
omit(Set<Integer> theOmittedJobNumbers)
Omit the job numbers in the given set when generating jobs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JobGenerator()
| Method Detail |
|---|
public void omit(Set<Integer> theOmittedJobNumbers)
theOmittedJobNumbers - Set of job numbers to be omitted.
NullPointerException - (unchecked exception) Thrown if theOmittedJobNumbers is
null.public Iterator<Job> iterator()
iterator in interface Iterable<Job>protected abstract int jobCount()
protected abstract Job createJob(int theJobNumber)
theJobNumber - Job number (0 .. N−1).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||