]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_4_2-src/main/classes/core/src/com/ibm/icu/text/RbnfLenientScanner.java
go
[Dictionary.git] / jars / icu4j-4_4_2-src / main / classes / core / src / com / ibm / icu / text / RbnfLenientScanner.java
1 /*\r
2  *******************************************************************************\r
3  * Copyright (C) 2009-2010, International Business Machines Corporation and    *\r
4  * others. All Rights Reserved.                                                *\r
5  *******************************************************************************\r
6  */\r
7 \r
8 package com.ibm.icu.text;\r
9 \r
10 /**\r
11  * Used by RBNF to leniently parse a string.\r
12  *\r
13  * @draft ICU 4.4\r
14  * @provisional This API might change or be removed in a future release.\r
15  */\r
16 public interface RbnfLenientScanner {\r
17     /**\r
18      * Returns true if a string consists entirely of ignorable\r
19      * characters.\r
20      * @param s The string to test\r
21      * @return true if the string is empty or consists entirely of\r
22      * characters that are ignorable.\r
23      * @draft ICU 4.4\r
24      * @provisional This API might change or be removed in a future release.\r
25      */\r
26     boolean allIgnorable(String s);\r
27 \r
28     /**\r
29      * Matches characters in a string against a prefix and return\r
30      * the number of chars that matched, or 0 if no match.  Only\r
31      * primary-order differences are significant in determining\r
32      * whether there's a match.  This means that the returned\r
33      * value need not be the same as the length of the prefix.\r
34      *\r
35      * @param str The string being tested\r
36      * @param prefix The text we're hoping to see at the beginning of "str"\r
37      * @return the number of characters in "str" that were matched\r
38      * @draft ICU 4.4\r
39      * @provisional This API might change or be removed in a future release.\r
40      */\r
41     int prefixLength(String str, String prefix);\r
42 \r
43     /**\r
44      * Searches a string for another string.  This might use a\r
45      * Collator to compare strings, or just do a simple match.\r
46      * @param str The string to search\r
47      * @param key The string to search "str" for\r
48      * @param startingAt The index into "str" where the search is to\r
49      * begin\r
50      * @return A two-element array of ints.  Element 0 is the position\r
51      * of the match, or -1 if there was no match.  Element 1 is the\r
52      * number of characters in "str" that matched (which isn't necessarily\r
53      * the same as the length of "key")\r
54      * @draft ICU 4.4\r
55      * @provisional This API might change or be removed in a future release.\r
56      */\r
57     int[] findText(String str, String key, int startingAt);\r
58 }