|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSensorComparator
LightComparator
public class LightComparator
Provides a Comparator implementation for the combined light sensors. By "combined" we mean that we are implementing a "virtual" sensor that has a value that is the sum of the real left and right sensors.
Constructor Summary | |
---|---|
LightComparator()
|
Method Summary | |
---|---|
int |
compare(FinchSensor obj1,
FinchSensor obj2)
Compare two FinchSensor objects: light sensor |
double |
doubleValue(FinchSensor obj)
Return the value of obj that is specified by the instantiation of the child class. |
java.lang.String |
toString()
Force the child class to return a string that describes itself. |
Methods inherited from class SensorComparator |
---|
compare, compare, sum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Constructor Detail |
---|
public LightComparator()
Method Detail |
---|
public int compare(FinchSensor obj1, FinchSensor obj2)
obj1
- FinchSensor objectobj2
- FinchSensor object
public double doubleValue(FinchSensor obj)
SensorComparator
doubleValue
in class SensorComparator
obj
- A FinchSensor sample
public java.lang.String toString()
SensorComparator
toString
in class SensorComparator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |