Lines Matching defs:hint
461 * @param hint the index at which to begin the search, 0 <= hint < n.
462 * The closer hint is to the result, the faster this method will run.
470 int base, int len, int hint) {
471 if (DEBUG) assert len > 0 && hint >= 0 && hint < len;
475 if (key.compareTo(a[base + hint]) > 0) {
476 // Gallop right until a[base+hint+lastOfs] < key <= a[base+hint+ofs]
477 int maxOfs = len - hint;
478 while (ofs < maxOfs && key.compareTo(a[base + hint + ofs]) > 0) {
488 lastOfs += hint;
489 ofs += hint;
490 } else { // key <= a[base + hint]
491 // Gallop left until a[base+hint-ofs] < key <= a[base+hint-lastOfs]
492 final int maxOfs = hint + 1;
493 while (ofs < maxOfs && key.compareTo(a[base + hint - ofs]) <= 0) {
504 lastOfs = hint - ofs;
505 ofs = hint - tmp;
535 * @param hint the index at which to begin the search, 0 <= hint < n.
536 * The closer hint is to the result, the faster this method will run.
540 int base, int len, int hint) {
541 if (DEBUG) assert len > 0 && hint >= 0 && hint < len;
545 if (key.compareTo(a[base + hint]) < 0) {
546 // Gallop left until a[b+hint - ofs] <= key < a[b+hint - lastOfs]
547 int maxOfs = hint + 1;
548 while (ofs < maxOfs && key.compareTo(a[base + hint - ofs]) < 0) {
559 lastOfs = hint - ofs;
560 ofs = hint - tmp;
561 } else { // a[b + hint] <= key
562 // Gallop right until a[b+hint + lastOfs] <= key < a[b+hint + ofs]
563 int maxOfs = len - hint;
564 while (ofs < maxOfs && key.compareTo(a[base + hint + ofs]) >= 0) {
574 lastOfs += hint;
575 ofs += hint;