SunSPOT API V5.0


com.sun.spot.sensorboard.peripheral
Class LEDColor

java.lang.Object
  extended by com.sun.spot.sensorboard.peripheral.LEDColor

public class LEDColor
extends Object

Color class to be used by TriColorLED. Overloaded as a container for some static definitions of regularly used colors.

Author:
arshan

Field Summary
static LEDColor BLUE
          standard definition of the color blue
static LEDColor CHARTREUSE
          standard definition of the color chartreuse
static LEDColor CYAN
          standard definition of the color cyan
static LEDColor GREEN
          standard definition of the color green
static LEDColor MAGENTA
          standard definition of the color magenta
static LEDColor MAUVE
          standard definition of the color mauve
static LEDColor ORANGE
          non-standard definition of the color orange (color corrected for LEDs)
static LEDColor PUCE
          standard definition of the color puce
static LEDColor RED
          standard definition of the color red
static LEDColor TURQUOISE
          standard definition of the color turquoise
static LEDColor WHITE
          standard definition of the color white
static LEDColor YELLOW
          non-standard definition of the color yellow (color corrected for LEDs)
 
Constructor Summary
LEDColor(int r, int g, int b)
          Creates a new instance of LEDColor
 
Method Summary
 int blue()
           
 boolean equals(Object obj)
          Indicates whether some other object is "equal to" this one.
 int green()
           
 int hashCode()
          Returns a hash code value for the object.
 int red()
          return the value of the red portion of this color
 void setBlue(int val)
           
 void setGreen(int val)
           
 void setRed(int val)
           
 void setRGB(int r, int g, int b)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RED

public static final LEDColor RED
standard definition of the color red


GREEN

public static final LEDColor GREEN
standard definition of the color green


BLUE

public static final LEDColor BLUE
standard definition of the color blue


CYAN

public static final LEDColor CYAN
standard definition of the color cyan


MAGENTA

public static final LEDColor MAGENTA
standard definition of the color magenta


YELLOW

public static final LEDColor YELLOW
non-standard definition of the color yellow (color corrected for LEDs)


TURQUOISE

public static final LEDColor TURQUOISE
standard definition of the color turquoise


PUCE

public static final LEDColor PUCE
standard definition of the color puce


MAUVE

public static final LEDColor MAUVE
standard definition of the color mauve


CHARTREUSE

public static final LEDColor CHARTREUSE
standard definition of the color chartreuse


ORANGE

public static final LEDColor ORANGE
non-standard definition of the color orange (color corrected for LEDs)


WHITE

public static final LEDColor WHITE
standard definition of the color white

Constructor Detail

LEDColor

public LEDColor(int r,
                int g,
                int b)
Creates a new instance of LEDColor

Parameters:
r - initial values of the red value, range 0-255
g - initial values of the green value, range 0-255
b - initial values of the blue value, range 0-255
Method Detail

red

public int red()
return the value of the red portion of this color

Returns:
value of the red portion of this color, range 0-255

green

public int green()

blue

public int blue()

setRGB

public void setRGB(int r,
                   int g,
                   int b)

setRed

public void setRed(int val)

setGreen

public void setGreen(int val)

setBlue

public void setBlue(int val)

equals

public boolean equals(Object obj)
Description copied from class: Object
Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation:

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).

Overrides:
equals in class Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Boolean.hashCode(), Hashtable

hashCode

public int hashCode()
Description copied from class: Object
Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Overrides:
hashCode in class Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object), Hashtable

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.