EntryResult[] queryIn(Index index) throws IOException { char[] key = this.selector; // can be null int matchRule = getMatchRule(); switch (getMatchMode()) { case R_EXACT_MATCH: if (this.isCamelCase) break; if (this.selector != null && this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector, this.parameterCount); else { // do a prefix query with the selector matchRule &= ~R_EXACT_MATCH; matchRule |= R_PREFIX_MATCH; } break; case R_PREFIX_MATCH: // do a prefix query with the selector break; case R_PATTERN_MATCH: if (this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector == null ? ONE_STAR : this.selector, this.parameterCount); else if (this.selector != null && this.selector[this.selector.length - 1] != '*') key = CharOperation.concat(this.selector, ONE_STAR, SEPARATOR); // else do a pattern query with just the selector break; case R_REGEXP_MATCH: // TODO (frederic) implement regular expression match break; } return index.query( getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null }