All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.tools.v2-0.NumericCompare

java.lang.Object
   |
   +----com.roguewave.tools.v2-0.NumericCompare

public class NumericCompare
extends Object
implements Comparator, Serializable
Class NumericCompare implements the Comparator interface for classes inheriting from java.lang.Number (e.g. Integer, Long, Float and Double). The numbers are converted to values of type double before being compared.

See Also:
BinaryTree, BTree

Constructor Index

 o NumericCompare()

Method Index

 o compare(Object, Object)
Compares two Numbers using their double values.

Constructors

 o NumericCompare
 public NumericCompare()

Methods

 o compare
 public int compare(Object x,
                    Object y)
Compares two Numbers using their double values.

Returns:
1, 0, or -1 depending on whether
   ((Number)x).doubleValue() - ((Number)y).doubleValue()
 
is greater than, equal to, or less than 0 respectively.

All Packages  Class Hierarchy  This Package  Previous  Next  Index