source: xssim/trunk/src/test/rewolucja/energy/profile/CPUPowerProfileFactory.java @ 104

Revision 104, 526 bytes checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package test.rewolucja.energy.profile;
2
3import test.rewolucja.resources.Category;
4
5public class CPUPowerProfileFactory {
6
7        public static CPUPowerProfile createCPUPowerProfile(Category cat) {
8                if(cat.getName().equals("A")){
9                        return new CPU_A_PowerProfile();
10                } else if (cat.getName().equals("B")){
11                        return new CPU_B_PowerProfile();
12                } else if (cat.getName().equals("C")){
13                        return new CPU_C_PowerProfile();
14                } else
15                        throw new IllegalArgumentException("The CPU Model " + cat.getName() + " is not recognized.");
16        }
17}
Note: See TracBrowser for help on using the repository browser.