2 *******************************************************************************
3 * Copyright (C) 2009-2010, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
8 package com.ibm.icu.text;
11 * Used by RBNF to leniently parse a string.
14 * @provisional This API might change or be removed in a future release.
16 public interface RbnfLenientScanner {
18 * Returns true if a string consists entirely of ignorable
20 * @param s The string to test
21 * @return true if the string is empty or consists entirely of
22 * characters that are ignorable.
24 * @provisional This API might change or be removed in a future release.
26 boolean allIgnorable(String s);
29 * Matches characters in a string against a prefix and return
30 * the number of chars that matched, or 0 if no match. Only
31 * primary-order differences are significant in determining
32 * whether there's a match. This means that the returned
33 * value need not be the same as the length of the prefix.
35 * @param str The string being tested
36 * @param prefix The text we're hoping to see at the beginning of "str"
37 * @return the number of characters in "str" that were matched
39 * @provisional This API might change or be removed in a future release.
41 int prefixLength(String str, String prefix);
44 * Searches a string for another string. This might use a
45 * Collator to compare strings, or just do a simple match.
46 * @param str The string to search
47 * @param key The string to search "str" for
48 * @param startingAt The index into "str" where the search is to
50 * @return A two-element array of ints. Element 0 is the position
51 * of the match, or -1 if there was no match. Element 1 is the
52 * number of characters in "str" that matched (which isn't necessarily
53 * the same as the length of "key")
55 * @provisional This API might change or be removed in a future release.
57 int[] findText(String str, String key, int startingAt);