Class ZaccelComparator

java.lang.Object
  extended by SensorComparator
      extended by ZaccelComparator
All Implemented Interfaces:
java.util.Comparator<FinchSensor>

public class ZaccelComparator
extends SensorComparator

Provides a Comparator implementation for the Z acceleration sensor.

DO NOT INCLUDE AUTHOR NAMES IN SOURCE FILE


Constructor Summary
ZaccelComparator()
           
 
Method Summary
 int compare(FinchSensor obj1, FinchSensor obj2)
          Compare two FinchSensor objects: Z acceleration
 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
arrayMagnitude, 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

ZaccelComparator

public ZaccelComparator()
Method Detail

compare

public int compare(FinchSensor obj1,
                   FinchSensor obj2)
Compare two FinchSensor objects: Z acceleration

Parameters:
obj1 - FinchSensor object
obj2 - 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