/** * Fifo class */ class Fifo { /** * Fifo constructor */ public Fifo() { super(); } /** * find the oldest page in memory * return the frame number of the oldest page */ public int findFrame(Memory memory, int size) { int frame[]; int oldest; int oldestFrame; // initialize oldest and oldestFrame frame = memory.getMemory(0); oldest = frame[1]; oldestFrame = 0; // check which frame is the oldest page for (int j=1; j 0) { if (frame[1] < oldest) { oldest = frame[1]; oldestFrame = j; } } } return oldestFrame; } /** * for testing: print out the context in memory */ public void printMemoryContext(Memory memory, int size) { for (int j=0; j