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