-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputTable.java
More file actions
43 lines (38 loc) · 896 Bytes
/
InputTable.java
File metadata and controls
43 lines (38 loc) · 896 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
42
43
import java.util.*;
public class InputTable
{
public static ArrayList<InputEntry> ipTable = new ArrayList<InputEntry>();
public static void add(InputEntry newEntry) {
// TODO Auto-generated method stub
ipTable.add(newEntry);
}
public static void display()
{
for(InputEntry ip: ipTable)
{
System.out.println(ip.pname);
System.out.println(ip.start_time);
for(RunSpec i: ip.reqs)
{
System.out.println(i.type + " - " + i);
}
System.out.println(">>printed one item");
System.out.println();
}
}
public static void checkfornewprocess(int current_time)
{
for(InputEntry ip: ipTable){
if(ip.start_time<=current_time && ip.exists==0)
{
System.out.println("Found a new entry to add to PCB");
int success = PCB.addNewEntry(ip);
if(success==0)
{
System.out.println("Adding succeeded");
ip.exists=1;
}
}
}
}
}