Subversion Repositories programming

Rev

Rev 416 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 416 Rev 417
Line 36... Line 36...
36
    public final String name;
36
    public final String name;
37
 
37
 
38
    /** The Process' burst time */
38
    /** The Process' burst time */
39
    public final int timeslice;
39
    public final int timeslice;
40
 
40
 
41
    /** The time when this process started running */
41
    /** The time when this process entered the run queue */
42
    public int started_at = 0;
42
    public final int entered_at;
43
 
43
 
44
    /** The time when this process completed */
44
    /** The time when this process completed */
45
    public int finished_at = 0;
45
    public int finished_at = 0;
46
 
46
 
47
    /** The amount of time this Process has left */
47
    /** The amount of time this Process has left */
Line 56... Line 56...
56
     * @param name this Process' name
56
     * @param name this Process' name
57
     * @param timeslice the burst time for this process
57
     * @param timeslice the burst time for this process
58
     */
58
     */
59
    public Process (String name, int timeslice)
59
    public Process (String name, int timeslice)
60
    {
60
    {
-
 
61
        this (name, timeslice, 0);
-
 
62
    }
-
 
63
 
-
 
64
    /**
-
 
65
     * Constructor for the Process class. This specifies a time
-
 
66
     * at which this process will be added to the run queue in
-
 
67
     * this scheduler.
-
 
68
     *
-
 
69
     * @param name this Process' name
-
 
70
     * @param timeslice the burst time for this process
-
 
71
     * @param add_time the time at which this process will become valid
-
 
72
     */
-
 
73
    public Process (String name, int timeslice, int add_time)
-
 
74
    {
61
        this.name = name;
75
        this.name = name;
62
        this.timeslice = timeslice;
76
        this.timeslice = timeslice;
63
        this.time_left = timeslice;
77
        this.time_left = timeslice;
-
 
78
        this.entered_at = add_time;
64
    }
79
    }
65
 
80
 
66
    /**
81
    /**
67
     * Copy constructor for the Process class.
82
     * Copy constructor for the Process class.
68
     *
83
     *
Line 70... Line 85...
70
     */
85
     */
71
    public Process (Process p)
86
    public Process (Process p)
72
    {
87
    {
73
        this.name = new String (p.name);
88
        this.name = new String (p.name);
74
        this.timeslice = p.timeslice;
89
        this.timeslice = p.timeslice;
-
 
90
        this.entered_at = p.entered_at;
-
 
91
        this.finished_at = p.finished_at;
75
        this.time_left = p.timeslice;
92
        this.time_left = p.timeslice;
76
    }
93
    }
77
 
94
 
78
    /**
95
    /**
79
     * Convert this Process to a String for printing.
96
     * Convert this Process to a String for printing.