I am working on a CPU scheduler for an operating systems course.
There are no compilation errors or warnings, but my output file is incorrect.
What is happening is I am using PrintWriter class to write line by line to an output.
I have the following for loop.
for (int TerminationListIndex = 0; TerminationListIndex < TerminationList.size(); TerminationListIndex++)
{
Termination_Info TerminationStats = TerminationList.get(TerminationListIndex);
Output.println(TerminationStats.getJob_ID() + " " +
TerminationStats.getClassType() + " " +
TerminationStats.getArrivalTime() + " " +
TerminationStats.getLoadingTime() + " " +
TerminationStats.getTerminationTime() + " " +
TerminationStats.getProcessingTime() + " " +
TerminationStats.getTurnaroundTime() + " " +
TerminationStats.getWaitingTime());
}
In my eclipse debugger I can view the the TerminationList and see that it holds different objects. The output, however, will print the LAST object in the lists' parameters (Job_ID, Class, ArrTime, LoadTime, TermTime, ProcTime, TurnTime, WaitTime) and I end up with a n output file that has hundreds of lines with the same parameters. In terms of logic, I am fairly confident that it is just some syntax error. Any advice would be greatly appreciated.