-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProcess.java
38 lines (31 loc) · 932 Bytes
/
Process.java
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
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class Process {
private int id;
private List<Integer> requestingResourceList;
private List<Integer> alocatedRecourcesList;
public Process(int id) {
this.id = id;
this.requestingResourceList = new ArrayList<>();
this.alocatedRecourcesList = new ArrayList<>();
}
public int getId(){
return this.id;
}
public List<Integer> getAlocatedResourcesList(){
return alocatedRecourcesList;
}
public List<Integer> getRequestingResourcesList(){
return requestingResourceList;
}
public boolean addRequestResource(int resourceId){
requestingResourceList.add(resourceId);
return true;
}
public boolean addAlocatedResources(int resourceId){
alocatedRecourcesList.add(resourceId);
return true;
}
}