|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.util.Compare
public class Compare
Some handy static methods to compare two Comparables even if one or both are null-pointers.
| Constructor Summary | |
|---|---|
Compare()
|
|
| Method Summary | ||
|---|---|---|
static
|
compare(T o1,
T o2)
Compares two objects. null is being treated as smallest value. |
|
static int |
compareLong(long val1,
long val2)
Compares two long integers. Notice when checking object-ids: make sure that values are provided from getId() because deleted objects change their id (negate), but don't change their identity! |
|
static
|
compareWithNullLargest(T o1,
T o2)
Compares two objects. null is being treated as largest value. |
|
static boolean |
equals(Object o1,
Object o2)
Checks whether two objects are equal. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Compare()
| Method Detail |
|---|
public static <T extends Comparable<? super T>> int compare(T o1,
T o2)
null is being treated as smallest value.
T - the class typeo1 - the first objecto2 - the second object
public static <T extends Comparable<? super T>> int compareWithNullLargest(T o1,
T o2)
null is being treated as largest value.
T - the class typeo1 - the first objecto2 - the second object
public static boolean equals(Object o1,
Object o2)
o1 - the first objecto2 - the second object
public static int compareLong(long val1,
long val2)
val1 - the first valueval2 - the second value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||