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)
| 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}. |