lt.monarch.chart.util
Class DoubleComparator

java.lang.Object
  extended by lt.monarch.chart.util.DoubleComparator

public class DoubleComparator
extends java.lang.Object


Field Summary
Modifier and Type Field and Description
static double EPSILON
           
 
Constructor Summary
Constructor and Description
DoubleComparator()
           
 
Method Summary
Modifier and Type Method and Description
static boolean equals(double a, double b)
          Returns true if two doubles are considered equal.
static boolean equals(double a, double b, double epsilon)
          Returns true if two doubles are considered equal.
static boolean greaterOrEqual(double a, double b)
           
static boolean greaterOrEqual(double a, double b, double epsilon)
           
static boolean greaterThan(double a, double b)
          Returns true if the first double is considered greater than the second double.
static boolean greaterThan(double a, double b, double epsilon)
          Returns true if the first double is considered greater than the second double.
static boolean lessOrEqual(double a, double b)
           
static boolean lessOrEqual(double a, double b, double epsilon)
           
static boolean lessThan(double a, double b)
          Returns true if the first double is considered less than the second double.
static boolean lessThan(double a, double b, double epsilon)
          Returns true if the first double is considered less than the second double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPSILON

public static final double EPSILON
See Also:
Constant Field Values
Constructor Detail

DoubleComparator

public DoubleComparator()
Method Detail

equals

public static boolean equals(double a,
                             double b)
Returns true if two doubles are considered equal. Tests if the absolute difference between two doubles has a difference less then EPSILON.

Parameters:
a - double to compare.
b - double to compare.
Returns:
true true if two doubles are considered equal.

equals

public static boolean equals(double a,
                             double b,
                             double epsilon)
Returns true if two doubles are considered equal. Tests if the absolute difference between the two doubles has a difference less then a given double (epsilon).

Parameters:
a - double to compare.
b - double to compare
epsilon - double which is compared to the absolute difference of two doubles to determine if they are equal.
Returns:
true if a is considered equal to b.

greaterThan

public static boolean greaterThan(double a,
                                  double b)
Returns true if the first double is considered greater than the second double. Test if the difference of first minus second is greater then .EPSILON.

Parameters:
a - first double
b - second double
Returns:
true if the first double is considered greater than the second double

greaterThan

public static boolean greaterThan(double a,
                                  double b,
                                  double epsilon)
Returns true if the first double is considered greater than the second double. Test if the difference of first minus second is greater then a given double (epsilon).

Parameters:
a - first double
b - second double
Returns:
true if the first double is considered greater than the second double

lessThan

public static boolean lessThan(double a,
                               double b)
Returns true if the first double is considered less than the second double. Test if the difference of second minus first is greater then EPSILON.

Parameters:
a - first double
b - second double
Returns:
true if the first double is considered less than the second double

lessThan

public static boolean lessThan(double a,
                               double b,
                               double epsilon)
Returns true if the first double is considered less than the second double. Test if the difference of second minus first is greater then a given double (epsilon).

Parameters:
a - first double
b - second double
Returns:
true if the first double is considered less than the second double

lessOrEqual

public static boolean lessOrEqual(double a,
                                  double b)

lessOrEqual

public static boolean lessOrEqual(double a,
                                  double b,
                                  double epsilon)

greaterOrEqual

public static boolean greaterOrEqual(double a,
                                     double b)

greaterOrEqual

public static boolean greaterOrEqual(double a,
                                     double b,
                                     double epsilon)