Home | History | Annotate | Download | only in util

Lines Matching refs:query

29  * contact's display name matches a numeric query. The boolean variable {@link #ALLOW_INITIAL_MATCH}
42 private String query;
44 // Controls whether to treat an empty query as a match (with anything).
47 public SmartDialNameMatcher(String query) {
48 this.query = query;
105 * Matches a phone number against a query. Let the test application overwrite the NANP setting.
108 * @param query - Normalized query (only contains numbers from 0-9)
109 * @return {@literal null} if the number and the query don't match, a valid SmartDialMatchPosition
113 public SmartDialMatchPosition matchesNumber(Context context, String phoneNumber, String query) {
122 matchesNumberWithOffset(context, phoneNumber, query, /* offset = */ 0);
129 context, phoneNumber, query, phoneNumberTokens.countryCodeOffset);
133 matchesNumberWithOffset(context, phoneNumber, query, phoneNumberTokens.nanpCodeOffset);
143 * Matches a phone number against the saved query, taking care of formatting characters and also
147 * @return {@literal null} if the number and the query don't match, a valid SmartDialMatchPosition
151 return matchesNumber(context, phoneNumber, query);
155 * Matches a phone number against a query, taking care of formatting characters
158 * @param query - Normalized query (only contains numbers from 0-9)
161 * @return {@literal null} if the number and the query don't match, a valid SmartDialMatchPosition
165 Context context, String phoneNumber, String query, int offset) {
166 if (TextUtils.isEmpty(phoneNumber) || TextUtils.isEmpty(query)) {
172 if (queryAt == query.length()) {
177 if (ch != query.charAt(queryAt)) {
183 // Found a separator before any part of the query was matched, so advance the
185 // query.
203 * This function iterates through each token in the display name, trying to match the query to the
222 * @param query The string of digits that we want to match the display name to.
225 * @return Returns true if a combination of the tokens in displayName match the query string
226 * contained in query. If the function returns true, matchList will contain an ArrayList of
232 String query,
237 final int queryLength = query.length();
251 // The current character in the query we are trying to match the displayName against
273 if (ch != query.charAt(queryStart)) {
274 // Failed to match the current character in the query.
276 // Case 1: Failed to match the first character in the query. Skip to the next
277 // token since there is no chance of this token matching the query.
279 // Case 2: Previous characters in the query matched, but the current character
281 // token since there is no chance of this token matching the query.
283 // Case 3: Previous characters in the query matched, but the current character
285 // this case, we should restart the query and try again with the current token.
286 // Otherwise, we would fail to match a query like "964"(yog) against a name
287 // Yo-Yoghurt because the query match would fail on the 3rd character, and
306 // Restart the query and set the correct token position
324 // characters in the query string and the remaining tokens
325 // find the next separator in the query string
339 context, remainder, query.substring(queryStart + 1), partialTemp)) {
353 // we matched the current character in the name against one in the query,
385 * This function iterates through each token in the display name, trying to match the query to the
404 * @return Returns true if a combination of the tokens in displayName match the query string
405 * contained in query. If the function returns true, matchList will contain an ArrayList of
410 return matchesCombination(context, displayName, query, matchPositions);
420 return query;
423 public void setQuery(String query) {
424 this.query = query;