int (boolean valuedStartMatch, int patternIndex, boolean humpStartMatchedUpperCase, int nameIndex, boolean afterGap, boolean isHumpStart, char nameChar) { if (afterGap && isHumpStart && isLowerCase[patternIndex]) { return -10; // disprefer when there's a hump but nothing in the pattern indicates the user meant it to be hump } if (nameChar == myPattern[patternIndex]) { if (isUpperCase[patternIndex]) return 50; // strongly prefer user's uppercase matching uppercase: they made an effort to press Shift if (nameIndex == 0 && valuedStartMatch) return 150; // the very first letter case distinguishes classes in Java etc if (isHumpStart) return 1; // if a lowercase matches lowercase hump start, that also means something } else if (isHumpStart) { // disfavor hump starts where pattern letter case doesn't match name case return -1; } else if (isLowerCase[patternIndex] && humpStartMatchedUpperCase) { // disfavor lowercase non-humps matching uppercase in the name return -1; } return 0; }