Documentation of 'edu.rit.pj.job.JobGenerator' Java class
JobGenerator
edu.rit.pj.job

Class JobGenerator

  • All Implemented Interfaces:
    java.lang.Iterable<Job>
    Direct Known Subclasses:
    Test01


    public abstract class JobGenerator
    extends java.lang.Object
    implements java.lang.Iterable<Job>
    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

      Constructors 
      Constructor and Description
      JobGenerator()
      Construct a new job generator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Iterator<Job> iterator()
      Get an iterator for generating the jobs in the job group.
      void omit(java.util.Set<java.lang.Integer> theOmittedJobNumbers)
      Omit the job numbers in the given set when generating jobs.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • JobGenerator

        public JobGenerator()
        Construct a new job generator.
    • Method Detail

      • omit

        public void omit(java.util.Set<java.lang.Integer> theOmittedJobNumbers)
        Omit the job numbers in the given set when generating jobs. To be effective, omit() must be called before calling iterator(). A snapshot of the given set is taken; changing the set's contents thereafter will not affect the job numbers to be omitted.
        Parameters:
        theOmittedJobNumbers - Set of job numbers to be omitted.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if theOmittedJobNumbers is null.
      • iterator

        public java.util.Iterator<Job> iterator()
        Get an iterator for generating the jobs in the job group.
        Specified by:
        iterator in interface java.lang.Iterable<Job>
        Returns:
        Iterator.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.