From: syn w. <syn...@jt...> - 2002-10-25 23:44:46
|
Markus, IYou have a point. 'll remove the API public static final int CASE_SENSITIVE and replace the following APIs public StringComparator(boolean codeunitcompare, boolean ignorecase, int casecompare) and public void setCaseCompare(int casecompare) public int get CaseCompare() with public StringComparator(boolean codepointcompare, boolean ignorecase, int options) public void setIgnoreCase(boolean on, int options) public boolean getIgnoreCase() public int getIgnoreCaseOptions() where the options can be either FOLD_CASE_DEFAULT or FOLD_CASE_EXCLUDE_SPECIAL_I. ----- Original Message ----- From: "Markus Scherer" <mar...@jt...> To: "icu list" <ic...@os...>; "icu4j-support" <icu...@os...> Sent: Friday, October 25, 2002 10:59 AM Subject: Re: ICU4J proposal to add code unit and case insensitive string comparison to com.ibm.icu.text.UTF16.StringComparator > syn wee wrote: > > 3 new constants to indicate the case comparison options will be added > > > > public static final int CASE_SENSITIVE that does case sensitive comparison. > > > > public static final int FOLD_CASE_DEFAULT that does case insensitive > > comparison. Strings are folded using default mappings defined in Unicode > > data file CaseFolding.txt, before comparison. > > > > public static final int FOLD_CASE_EXCLUDE_SPECIAL_I ... > > I would like to propose a small change to make this work like in ICU4C - which will help porting and > maintenance: > > Instead of having a non-zero value for CASE_SENSITIVE, ICU4C uses an all-zero value for the default > behavior of case-sensitive comparison, and a non-zero bit flag like IGNORE_CASE. Only if the latter > is set are the FOLD_CASE_* flags used. > > This makes not only the default behavior use an all-zero integer option argument, but also helps use > the same option bit set internally in an implementation that is parallel to ICU4C's. The > implementation function handles canonically-equivalent comparisons as well, and some of the related > flags would collide with a likely choice of value (-1) for CASE_SENSITIVE. > > markus > > _______________________________________________ > icu mailing list > ic...@os... > http://oss.software.ibm.com/developerworks/oss/mailman/listinfo/icu > |