fr.cnes.sirius.patrius.tools.ephemerisComparator
Interface DeviationProvider

All Known Implementing Classes:
DateDPFacade, DoubleDPFacade, PVCoordinatesDPFacade, QuaternionDPFacade, RotationDPFacade, VectorDPFacade

public interface DeviationProvider

This interface specify one method, the computation of a deviation. It works exactly the same as the Comparable interface, for it is generic as well, and provides one method of comparison, computeDeviationTo. Moreover, if one wanted his object to also implement Comparable, he could simply use the computeDeviationTo method and only use the sign of the deviation to get the correct results for the compareTo method. This might be useful for object difficult to compare one to another.

This interface has to be implemented in order for a data type to be used in the comparator tool. In doing so, one has to specify which type of Data the computeDeviationTo concerns.

Since:
1.0
Version:
$Id: DeviationProvider.java 6320 2012-09-20 15:36:28Z CardosoP $
Author:
Philippe Pavero
See Also:
Comparable

Method Summary
 double computeDeviationTo(boolean type, DeviationProvider obj, boolean positive)
          Computes the deviation from the current object (this) to the object in parameter.
 

Method Detail

computeDeviationTo

double computeDeviationTo(boolean type,
                          DeviationProvider obj,
                          boolean positive)
Computes the deviation from the current object (this) to the object in parameter. Each kind of object has its own way of computing the deviation, which makes it all the more meaningful.

Parameters:
type - absolute or relative
obj - the object to compare the current one to.
positive - true if absolute value of deviations, false otherwise
Returns:
the deviation between the two objects, in double precision. The value is normally positive if the current object is greater than the other, but keep in mind that it is also quite possible that the sign represents something else, depending on the object type.
Since:
1.0


Copyright © 2016 CNES. All Rights Reserved.