mirror of
https://github.com/zach-sb/COMP2240-Assignment3.git
synced 2025-11-09 02:17:36 +11:00
Commit 1
This commit is contained in:
parent
939449415e
commit
2c60fc182e
55
A3.java
55
A3.java
@ -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
19
Process.java
Normal 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);
|
||||
// }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user