-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcess.java
More file actions
41 lines (35 loc) · 958 Bytes
/
Process.java
File metadata and controls
41 lines (35 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
public class Process implements Cloneable{
private int waitingTime;
private int burstTime;
public int arrivalTime;
public String pName;
public Process( String pName,int arrivalTime,int burstTime ) {
this.waitingTime = 0;
this.burstTime = burstTime;
this.arrivalTime = arrivalTime;
this.pName = pName;
}
@Override
protected Process clone() throws CloneNotSupportedException {
Process clone;
clone = new Process(pName,arrivalTime,burstTime);
clone.setWaitingTime(getWaitingTime());
return clone;
}
public int getBurstTime() {
return burstTime;
}
public void setBurstTime(int burstTime) {
this.burstTime = burstTime;
}
public int getWaitingTime() {
return waitingTime;
}
public void setWaitingTime(int waitingTime) {
this.waitingTime = waitingTime;
}
@Override
public String toString() {
return pName + "\t\t" +arrivalTime +"\t\t" +burstTime+"\t\t"+waitingTime;
}
}