Revision 477,
1.3 KB
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package schedframe.resources.computing.profiles.energy.power; |
---|
2 | |
---|
3 | public class PState { |
---|
4 | |
---|
5 | protected String name; |
---|
6 | protected double frequency; |
---|
7 | protected double voltage; |
---|
8 | protected double powerUsage; |
---|
9 | |
---|
10 | /*public PState(PStateType name, double frequency, double voltage, double power) { |
---|
11 | super(); |
---|
12 | this.name = name; |
---|
13 | this.frequency = frequency; |
---|
14 | this.voltage = voltage; |
---|
15 | this.power = power; |
---|
16 | }*/ |
---|
17 | |
---|
18 | public String getName() { |
---|
19 | return name; |
---|
20 | } |
---|
21 | public double getFrequency() { |
---|
22 | return frequency; |
---|
23 | } |
---|
24 | public double getVoltage() { |
---|
25 | return voltage; |
---|
26 | } |
---|
27 | public double getPower() { |
---|
28 | return powerUsage; |
---|
29 | } |
---|
30 | |
---|
31 | public static class Builder { |
---|
32 | |
---|
33 | protected String name; |
---|
34 | protected double frequency; |
---|
35 | protected double voltage; |
---|
36 | protected double powerUsage; |
---|
37 | |
---|
38 | public Builder name(String name){this.name = name; return this; } |
---|
39 | public Builder frequency(double value){this.frequency = value; return this; } |
---|
40 | public Builder voltage(double value){this.voltage = value; return this; } |
---|
41 | public Builder powerUsage(double rate){this.powerUsage = rate; return this; } |
---|
42 | |
---|
43 | public PState build() { |
---|
44 | return new PState(this); |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | private PState(Builder builder) { |
---|
49 | this.name = builder.name; |
---|
50 | this.frequency = builder.frequency; |
---|
51 | this.voltage = builder.voltage; |
---|
52 | this.powerUsage = builder.powerUsage; |
---|
53 | } |
---|
54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.