Revision 130,
811 bytes
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package test.rewolucja.energy.profile; |
---|
2 | |
---|
3 | import test.rewolucja.energy.profile.implementation.CPUPowerProfile; |
---|
4 | import test.rewolucja.energy.profile.implementation.CPU_A_PowerProfile; |
---|
5 | import test.rewolucja.energy.profile.implementation.CPU_B_PowerProfile; |
---|
6 | import test.rewolucja.energy.profile.implementation.CPU_C_PowerProfile; |
---|
7 | import test.rewolucja.resources.Category; |
---|
8 | |
---|
9 | public 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.