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

Revision 130, 811 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.energy.profile.implementation.CPUPowerProfile;
4import test.rewolucja.energy.profile.implementation.CPU_A_PowerProfile;
5import test.rewolucja.energy.profile.implementation.CPU_B_PowerProfile;
6import test.rewolucja.energy.profile.implementation.CPU_C_PowerProfile;
7import test.rewolucja.resources.Category;
8
9public class CPUPowerProfileFactory {
10
11        public static CPUPowerProfile createCPUPowerProfile(Category cat) {
12                if(cat.getName().equals("A")){
13                        return new CPU_A_PowerProfile();
14                } else if (cat.getName().equals("B")){
15                        return new CPU_B_PowerProfile();
16                } else if (cat.getName().equals("C")){
17                        return new CPU_C_PowerProfile();
18                } else
19                        throw new IllegalArgumentException("The CPU Model " + cat.getName() + " is not recognized.");
20        }
21}
Note: See TracBrowser for help on using the repository browser.