Class Processor


  • public class Processor
    extends java.lang.Object
    A data class that is used to simulate a processor on a site.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long mEndTime
      The end time of the current scheduled job.
      private long mStartTime
      The start time of the current scheduled job.
    • Constructor Summary

      Constructors 
      Constructor Description
      Processor()
      The default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getAvailableTime​(long start)
      Returns the earliest time the processor is available for scheduling a job.
      void scheduleJob​(long start, long end)
      Schedules a job on to a processor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mStartTime

        private long mStartTime
        The start time of the current scheduled job.
      • mEndTime

        private long mEndTime
        The end time of the current scheduled job.
    • Constructor Detail

      • Processor

        public Processor()
        The default constructor.
    • Method Detail

      • getAvailableTime

        public long getAvailableTime​(long start)
        Returns the earliest time the processor is available for scheduling a job. It is non insertion based scheduling policy.
        Parameters:
        start - the time at which to start the search.
        Returns:
        long
      • scheduleJob

        public void scheduleJob​(long start,
                                long end)
        Schedules a job on to a processor.
        Parameters:
        start - the start time of the job.
        end - the end time for the job