package os;

import readinstruction.ReadInstruction;
import scheduler.Scheduler;
import utils.Clock;
import java.util.Queue;

/**
 * Created by Karol on 2017-04-20.
 */
public class OSBuilder {
    private Clock systemClock;
    private Scheduler systemScheduler;
    private Queue<ReadInstruction> readQueue;
    private boolean consoleFlag;
}

@@ -46,16 +46,60 @@
 uction;%0A
+import readinstruction.ReadInstructionImpl;%0A
 import s
@@ -138,16 +138,17 @@
 .Clock;%0A
+%0A
 import j
@@ -155,18 +155,90 @@
 ava.
-util.Queue
+io.File;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.util.*
 ;%0A%0A/
@@ -452,11 +452,1135 @@
 oleFlag;
+%0A%0A    public OSBuilder withReadInstructions(ArrayList%3CReadInstruction%3E readQueue)%7B%0A        this.readQueue = new LinkedList%3C%3E();%0A        for (ReadInstruction instruction : readQueue) this.readQueue.add(instruction);%0A        return this;%0A    %7D%0A%0A    public OSBuilder withInstructionsSource(String filePath)%7B%0A        Queue%3CReadInstruction%3E result = new LinkedList%3C%3E();%0A        File inputFile = new File(filePath);%0A        try(FileReader fileIn = new FileReader(inputFile);%0A            Scanner dataIn = new Scanner(fileIn))%7B%0A            while(dataIn.hasNextLine())%7B%0A                String%5B%5D processText = dataIn.nextLine().split(%22, %22);%0A                result.add(new ReadInstructionImpl(%0A                        UUID.fromString(processText%5B0%5D),%0A                        Integer.parseInt(processText%5B1%5D),%0A                        Integer.parseInt(processText%5B2%5D),%0A                        Boolean.parseBoolean(processText%5B3%5D)));%0A            %7D%0A            this.readQueue = result;%0A        %7D catch (IOException e)%7B%0A            throw new IllegalArgumentException(%22File not found or data corrupted%22);%0A        %7D%0A        return this;%0A    %7D
 %0A%7D%0A

Implement withReadInstructions and withInstructionSource methods for OSBuilder