Class TimeComparator
java.lang.Object
SensorComparator
TimeComparator
- All Implemented Interfaces:
- java.util.Comparator<FinchSensor>
public class TimeComparator
- extends SensorComparator
Provides a Comparator implementation for the sensor time stamp
DO NOT INCLUDE AUTHOR NAMES IN SOURCE FILE
Method Summary |
int |
compare(FinchSensor obj1,
FinchSensor obj2)
Compare two FinchSensor objects: sensor sample time |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
TimeComparator
public TimeComparator()
compare
public int compare(FinchSensor obj1,
FinchSensor obj2)
- Compare two FinchSensor objects: sensor sample time
- Parameters:
obj1
- FinchSensor objectobj2
- FinchSensor object
- Returns:
- 1 if obj1 is larger than obj2, 0 if they are equal and -1 if obj1 is less than obj1
doubleValue
public double doubleValue(FinchSensor obj)
- Description copied from class:
SensorComparator
- Return the value of obj that is specified by the instantiation of the child
class.
- Specified by:
doubleValue
in class SensorComparator
- Parameters:
obj
- A FinchSensor sample
- Returns:
- The value of the sensor as a double
toString
public java.lang.String toString()
- Description copied from class:
SensorComparator
- Force the child class to return a string that describes itself.
- Specified by:
toString
in class SensorComparator
- Returns:
- A string describing this comparator