MCPcopy Create free account
hub / github.com/BaseXdb/basex / compare

Method compare

basex-core/src/main/java/org/basex/util/MinHeap.java:98–102  ·  view source on GitHub ↗

Compares the keys at position i and j. @param i position of first key @param j position of second key @return result of comparison

(final int i, final int j)

Source from the content-addressed store, hash-verified

96 * @return result of comparison
97 */
98 @SuppressWarnings("unchecked")
99 private int compare(final int i, final int j) {
100 final K a = (K) vals[2 * i], b = (K) vals[2 * j];
101 return comp == null ? ((Comparable<K>) a).compareTo(b) : comp.compare(a, b);
102 }
103
104 /**
105 * Swaps the entries at position {@code a} and {@code b}.

Callers 3

insertMethod · 0.95
removeMinMethod · 0.95
verifyMethod · 0.95

Calls 1

compareToMethod · 0.45

Tested by

no test coverage detected