|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRJavaComparator
public class RJavaComparator
Utility class to compare two objects in the sense of the java.lang.Comparable interface
Constructor Summary | |
---|---|
RJavaComparator()
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RJavaComparator()
Method Detail |
---|
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 object
a.compareTo(b)
if this makes sense
NotComparableException
- if the two objects are not comparable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |