This commit is contained in:
Zach S-B 2021-10-20 19:28:18 +11:00
parent 939449415e
commit 2c60fc182e
2 changed files with 74 additions and 0 deletions

55
A3.java
View File

@ -0,0 +1,55 @@
import java.util.*;
import java.io.*;
public class A3 {
public static void main(String[] args){
A3 system = new A3();
system.run("30 3 process1.txt process2.txt process3.txt"); //For TESTING Only
//system.run(args[0]);
}
public void run(String input)
{
LinkedList<Process> processList;
int frames = 0;
int quantum = 0;
String[] inputStrings;
inputStrings = input.split(" ");
for (int i = 0; i < inputStrings.length; i++)
{
System.out.println(inputStrings[i]);
}
//readFile(input);
}
public void readFile(String input)
{
Scanner fileReader; //Scanner to read the file.
File dataSet;// = new File(fileNameInput);
//Process importedProcess = new Process();
dataSet = new File(input);
//Try and open file. If it works, procede.
try {
fileReader = new Scanner(dataSet);
//Progress through each line in the text file
while(fileReader.hasNextLine())
{
String line = fileReader.nextLine();
}
fileReader.close();
}
//If the file isn't found, throw a hissy fit.
catch (FileNotFoundException e) {
System.out.println("File not found.");
System.exit(0);
//e.printStackTrace(); //Optional, shows more data.
}
// return importedProcess;
}
}

19
Process.java Normal file
View File

@ -0,0 +1,19 @@
import java.util.LinkedList;
public class Process {
//private LinkedList<Integer> pageRequest;
public Process(){
}
// public Process(LinkedList<Integer> pageRequestInput)
// {
// pageRequest = pageRequestInput;
// }
// public void addPageRequest(int input)
// {
// pageRequest.add(input);
// }
}