1 /** Class LightBulb interface for the light bulb devices.
3 * @author Ali Younis <ayounis @ uci.edu>
9 public class LightBulb {
16 /** Method to turn the light bulb on (Physically illuminate the area).
20 * @return [void] None.
23 public void turnOff() {
24 System.out.println("Bulb Turning Off")
27 /** Method to turn the light bulb off.
29 * @return [void] None.
31 public void turnOn() {
32 System.out.println("Bulb Turning On")
36 /** Method to get the current on/off state of the light bulb.
38 * @return [boolean] True means bulb on.
40 public boolean getState() {
45 /** Method to set the light bulb color using Standard Hue, Saturation and Brightness
46 * conventions. See "http://www.tydac.ch/color/" for reference.
48 * @param _hue [double]: Hue value (in degrees).
49 * @param _saturation [double]: Saturation value (percentage).
50 * @param _brightness [double]: Brightness value (percentage).
52 * @return [void] None.
54 public void setColor(double _hue, double _saturation, double _brightness) {
59 /** Method to set the color temperature.
61 * @param _temperature [int]: Color temperature in degrees kelvin.
63 * @return [void] None.
65 public void setTemperature(int _temperature) {
70 /** Method to get the current hue value of the bulb.
72 * @return [double] Current hue value of the bulb in degrees.
74 public double getHue() {
79 /** Method to get the current saturation value of the bulb.
81 * @return [double] Current saturation value of the bulb as a percentage.
83 public double getSaturation() {
89 /** Method to get the current brightness value of the bulb.
91 * @return [double] Current brightness value of the bulb as a percentage.
93 public double getBrightness() {
99 /** Method to get the current color temperature value of the bulb.
101 * @return [double] Current color temperature value of the bulb in kelvin.
103 public int getTemperature() {
109 /** Method to get the hue range lower bound supported by the bulb.
111 * @return [double] Hue lower bound in degrees.
113 public double getHueRangeLowerBound() {
119 /** Method to get the hue range upper bound supported by the bulb.
121 * @return [double] Hue upper bound in degrees.
123 public double getHueRangeUpperBound() {
129 /** Method to get the saturation range lower bound supported by the bulb.
131 * @return [double] Saturation lower bound as a percentage.
133 public double getSaturationRangeLowerBound() {
139 /** Method to get the saturation range upper bound supported by the bulb.
141 * @return [double] Saturation upper bound as a percentage.
143 public double getSaturationRangeUpperBound() {
149 /** Method to get the brightness range lower bound supported by the bulb.
151 * @return [double] Brightness lower bound as a percentage.
153 public double getBrightnessRangeLowerBound() {
159 /** Method to get the brightness range upper bound supported by the bulb.
161 * @return [double] Brightness upper bound as a percentage.
163 public double getBrightnessRangeUpperBound() {
168 /** Method to get the temperature range lower bound supported by the bulb.
170 * @return [int] Temperature lower bound as a percentage.
172 public int getTemperatureRangeLowerBound() {
178 /** Method to get the temperature range upper bound supported by the bulb.
180 * @return [int] Temperature upper bound as a percentage.
182 public int getTemperatureRangeUpperBound() {
188 /** Method to initialize the bulb, if the bulb needs to be initialized.
190 * @return [void] None.