MCPcopy Create free account
hub / github.com/apache/pig / compare

Method compare

src/org/apache/pig/data/DataType.java:460–465  ·  view source on GitHub ↗

/ Compare two objects to each other. This function is necessary because there's no super class that implements compareTo. This function provides an (arbitrary) ordering of objects of different types as follows: NULL < BOOLEAN < BYTE < INTEGER < LONG < FLOAT < DOUBLE < DATET

(Object o1, Object o2)

Source from the content-addressed store, hash-verified

458 * @return -1 if o1 is less, 0 if they are equal, 1 if o2 is less.
459 */
460 public static int compare(Object o1, Object o2) {
461
462 byte dt1 = findType(o1);
463 byte dt2 = findType(o2);
464 return compare(o1, o2, dt1, dt2);
465 }
466
467 /**
468 * Same as {@link #compare(Object, Object)}, but does not use reflection to determine the type

Callers 15

compareMethod · 0.95
poSortAscStringMethod · 0.95
poSortDescStringMethod · 0.95
poSortAscIntMethod · 0.95
poSortDescIntMethod · 0.95
testMethod · 0.95
testCompareMethod · 0.95
testNamesMethod · 0.95
compareToMethod · 0.95
compareKeysMethod · 0.95
compareMethod · 0.95

Calls 9

findTypeMethod · 0.95
entrySetMethod · 0.80
sizeMethod · 0.65
iteratorMethod · 0.65
getValueMethod · 0.65
compareToMethod · 0.45
hasNextMethod · 0.45
nextMethod · 0.45
getKeyMethod · 0.45

Tested by 8

poSortAscStringMethod · 0.76
poSortDescStringMethod · 0.76
poSortAscIntMethod · 0.76
poSortDescIntMethod · 0.76
testMethod · 0.76
testCompareMethod · 0.76
testNamesMethod · 0.76