fr.cnes.sirius.patrius.tools.ephemerisComparator
Class DoubleDPFacade

java.lang.Object
  extended by fr.cnes.sirius.patrius.tools.ephemerisComparator.DoubleDPFacade
All Implemented Interfaces:
DeviationProvider

public class DoubleDPFacade
extends Object
implements DeviationProvider

This class is a facade for the use of double precision real numbers. This should be used instead of the simple double to add the computeDeviationTo method. This way, the double numbers can be treated as any other type.

Since:
1.0
Version:
$Id: DoubleDPFacade.java 17581 2017-05-10 12:47:31Z bignon $
Author:
Philippe Pavero
See Also:
DeviationProvider
Concurrency :
immutable

Constructor Summary
protected DoubleDPFacade(double toBeStoredValue)
          Simple constructor that store the given double value.
 
Method Summary
 double computeDeviationTo(boolean absolute, DeviationProvider obj, boolean positive)
          computes the relative deviation between the stored double value and the given one.
 double getValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleDPFacade

protected DoubleDPFacade(double toBeStoredValue)
Simple constructor that store the given double value.

Parameters:
toBeStoredValue - the value to store.
Since:
1.0
Method Detail

computeDeviationTo

public final double computeDeviationTo(boolean absolute,
                                       DeviationProvider obj,
                                       boolean positive)
computes the relative deviation between the stored double value and the given one.

Specified by:
computeDeviationTo in interface DeviationProvider
Parameters:
absolute - absolute or relative deviation
obj - the DeviationProvider that should be a DoubleDPFacade
positive - true if absolute value of deviations, false otherwise
Returns:
the deviation between the two values. The deviation is positive if the stored value is greater than the one given, 0 if they are equal and negative if smaller.
Throws:
EphemerisComparatorRuntimeException - if the DeviationProvider is not of the correct type
See Also:
DeviationProvider.computeDeviationTo(boolean, DeviationProvider, boolean)

getValue

public final double getValue()
Returns:
the value


Copyright © 2017 CNES. All Rights Reserved.