Created
August 11, 2012 17:12
-
-
Save acompa/3325820 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ReplacementAlgorithm selectReplacementAlgorithm(String choice) { | |
if (choice.matches("N")) { | |
return new NRUAlgorithm(); | |
} else if (choice.matches("l")) { | |
return new LRUAlgorithm(); | |
} else if (choice.matches("r")) { | |
return new RandomAlgorithm(); | |
} else if (choice.matches("f")) { | |
return new FIFOAlgorithm(); | |
} else if (choice.matches("s")) { | |
return new SecondChanceAlgorithm(); | |
} else if (choice.matches("C")) { | |
return new VirtualClockAlgorithm(this.frames); | |
} else if (choice.matches("c")) { | |
return new PhysicalClockAlgorithm(this.frames); | |
} else if (choice.matches("A")) { | |
return new VirtualAgingAlgorithm(); | |
} else { | |
return new PhysicalAgingAlgorithm(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment