private static void downHeap(final IndexedSortable s, final int b, int i, final int N) { for (int idx = i << 1; idx < N; idx = i << 1) { if (idx + 1 < N && s.compare(b + idx, b + idx + 1) < 0) { if (s.compare(b + i, b + idx + 1) < 0) { s.swap(b + i, b + idx + 1); } else { return; } i = idx + 1; } else if (s.compare(b + i, b + idx) < 0) { s.swap(b + i, b + idx); i = idx; } else { return; } } }
private static void downHeap(final IndexedSortable s, final int b, int i, final int N) { for (int idx = i << 1; idx < N; idx = i << 1) { if (idx + 1 < N && s.compare(b + idx, b + idx + 1) < 0) { if (s.compare(b + i, b + idx + 1) < 0) { s.swap(b + i, b + idx + 1); } else { return; } i = idx + 1; } else if (s.compare(b + i, b + idx) < 0) { s.swap(b + i, b + idx); i = idx; } else { return; } } }
private static void downHeap(final IndexedSortable s, final int b, int i, final int N) { for (int idx = i << 1; idx < N; idx = i << 1) { if (idx + 1 < N && s.compare(b + idx, b + idx + 1) < 0) { if (s.compare(b + i, b + idx + 1) < 0) { s.swap(b + i, b + idx + 1); } else { return; } i = idx + 1; } else if (s.compare(b + i, b + idx) < 0) { s.swap(b + i, b + idx); i = idx; } else { return; } } }
private static void downHeap(final IndexedSortable s, final int b, int i, final int N) { for (int idx = i << 1; idx < N; idx = i << 1) { if (idx + 1 < N && s.compare(b + idx, b + idx + 1) < 0) { if (s.compare(b + i, b + idx + 1) < 0) { s.swap(b + i, b + idx + 1); } else { return; } i = idx + 1; } else if (s.compare(b + i, b + idx) < 0) { s.swap(b + i, b + idx); i = idx; } else { return; } } }
/** * Fix the records into sorted order, swapping when the first record is * greater than the second record. * * @param s paged sortable * @param pN page number of first record * @param pO page offset of first record * @param rN page number of second record * @param rO page offset of second record */ private static void fix(IndexedSortable s, int pN, int pO, int rN, int rO) { if (s.compare(pN, pO, rN, rO) > 0) { s.swap(pN, pO, rN, rO); } }
/** * Fix the records into sorted order, swapping when the first record is * greater than the second record. * * @param s paged sortable * @param pN page number of first record * @param pO page offset of first record * @param rN page number of second record * @param rO page offset of second record */ private static void fix(IndexedSortable s, int pN, int pO, int rN, int rO) { if (s.compare(pN, pO, rN, rO) > 0) { s.swap(pN, pO, rN, rO); } }
/** * Fix the records into sorted order, swapping when the first record is * greater than the second record. * * @param s paged sortable * @param pN page number of first record * @param pO page offset of first record * @param rN page number of second record * @param rO page offset of second record */ private static void fix(IndexedSortable s, int pN, int pO, int rN, int rO) { if (s.compare(pN, pO, rN, rO) > 0) { s.swap(pN, pO, rN, rO); } }
/** * Fix the records into sorted order, swapping when the first record is * greater than the second record. * * @param s paged sortable * @param pN page number of first record * @param pO page offset of first record * @param rN page number of second record * @param rO page offset of second record */ private static void fix(IndexedSortable s, int pN, int pO, int rN, int rO) { if (s.compare(pN, pO, rN, rO) > 0) { s.swap(pN, pO, rN, rO); } }