public class RJavaComparator
extends java.lang.Object
Constructor and Description |
---|
RJavaComparator() |
Modifier and Type | Method and Description |
---|---|
static int |
compare(java.lang.Object a,
java.lang.Object b)
compares a and b in the sense of the java.lang.Comparable if possible
instances of the Number interface are treated specially, in order to
allow comparing Numbers of different classes, for example it is allowed
to compare a Double with an Integer. if the Numbers have the same class,
they are compared normally, otherwise they are first converted to Doubles
and then compared
|
public static int compare(java.lang.Object a, java.lang.Object b) throws NotComparableException
instances of the Number interface are treated specially, in order to allow comparing Numbers of different classes, for example it is allowed to compare a Double with an Integer. if the Numbers have the same class, they are compared normally, otherwise they are first converted to Doubles and then compared
a
- an objectb
- another objecta.compareTo(b)
if this makes senseNotComparableException
- if the two objects are not comparable