/** * Class for returning statics for page replacement algorithm. */ public class PageReplacerStats { // see print() method for explanation of variables public int refs = 0; public int writeRefs = 0; public int pageFaults = 0; public int pageWriteOuts = 0; private String id; /** * Constructor. * @param id string to print (something that identifies the page * replacement algorithm */ public PageReplacerStats(String id) { this.id = id; } /** * Print all information to System.out. */ public void print() { System.out.println("Statistics for " + id + ":"); System.out.println("Total number of references: " + refs); System.out.println("Total number of write references: " + writeRefs); System.out.println("Number of page faults: " + pageFaults); System.out.println("Number of times a page was written out: " + pageWriteOuts); } }