|
SunSPOT API V5.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.spot.sensorboard.peripheral.LEDColor
public class LEDColor
Color class to be used by TriColorLED. Overloaded as a container for some static definitions of regularly used colors.
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 |
---|
public static final LEDColor RED
public static final LEDColor GREEN
public static final LEDColor BLUE
public static final LEDColor CYAN
public static final LEDColor MAGENTA
public static final LEDColor YELLOW
public static final LEDColor TURQUOISE
public static final LEDColor PUCE
public static final LEDColor MAUVE
public static final LEDColor CHARTREUSE
public static final LEDColor ORANGE
public static final LEDColor WHITE
Constructor Detail |
---|
public LEDColor(int r, int g, int b)
r
- initial values of the red value, range 0-255g
- initial values of the green value, range 0-255b
- initial values of the blue value, range 0-255Method Detail |
---|
public int red()
public int green()
public int blue()
public void setRGB(int r, int g, int b)
public void setRed(int val)
public void setGreen(int val)
public void setBlue(int val)
public boolean equals(Object obj)
Object
The equals
method implements an equivalence relation:
x
,
x.equals(x)
should return true
.
x
and
y
, x.equals(y)
should return
true
if and only if y.equals(x)
returns
true
.
x
,
y
, and z
, if x.equals(y)
returns true
and y.equals(z)
returns
true
, then x.equals(z)
should return
true
.
x
and y
, multiple invocations of x.equals(y)
consistently return true
or consistently return
false
, provided no information used in
equals
comparisons on the object is modified.
x
,
x.equals(null)
should return false
.
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
).
equals
in class Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.Boolean.hashCode()
,
Hashtable
public int hashCode()
Object
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
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.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
|
SunSPOT API V5.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |