ICU-9406 deprecate isHiraganaQuaternary(), setHiraganaQuaternary(boolean flag) and setHiraganaQuaternaryDefault(), disable the setters (merged from branches/markus/uni62 r32109, should not have been on that branch)

X-SVN-Rev: 32176
This commit is contained in:
Markus Scherer 2012-08-15 17:09:39 +00:00
parent 8c27e6926a
commit 527161ff5a
3 changed files with 25 additions and 17 deletions

View File

@ -327,37 +327,41 @@ public final class RuleBasedCollator extends Collator {
* Sets the Hiragana Quaternary mode to be on or off. When the Hiragana Quaternary mode is turned on, the collator
* positions Hiragana characters before all non-ignorable characters in QUATERNARY strength. This is to produce a
* correct JIS collation order, distinguishing between Katakana and Hiragana characters.
*
* This attribute is an implementation detail of the CLDR Japanese tailoring.
* The implementation might change to use a different mechanism
* to achieve the same Japanese sort order.
* Since ICU 50, this attribute is not settable any more via API functions.
*
* @param flag
* true if Hiragana Quaternary mode is to be on, false otherwise
* @see #setHiraganaQuaternaryDefault
* @see #isHiraganaQuaternary
* @stable ICU 2.8
* @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation.
*/
public void setHiraganaQuaternary(boolean flag) {
if (isFrozen()) {
throw new UnsupportedOperationException("Attempt to modify frozen object");
}
m_isHiragana4_ = flag;
updateInternalState();
}
/**
* Sets the Hiragana Quaternary mode to the initial mode set during construction of the RuleBasedCollator. See
* setHiraganaQuaternary(boolean) for more details.
*
* This attribute is an implementation detail of the CLDR Japanese tailoring.
* The implementation might change to use a different mechanism
* to achieve the same Japanese sort order.
* Since ICU 50, this attribute is not settable any more via API functions.
*
* @see #setHiraganaQuaternary(boolean)
* @see #isHiraganaQuaternary
* @stable ICU 2.8
* @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation.
*/
public void setHiraganaQuaternaryDefault() {
if (isFrozen()) {
throw new UnsupportedOperationException("Attempt to modify frozen object");
}
m_isHiragana4_ = m_defaultIsHiragana4_;
updateInternalState();
}
/**
@ -1187,11 +1191,16 @@ public final class RuleBasedCollator extends Collator {
/**
* Checks if the Hiragana Quaternary mode is set on. See setHiraganaQuaternary(boolean) for more details.
*
* This attribute is an implementation detail of the CLDR Japanese tailoring.
* The implementation might change to use a different mechanism
* to achieve the same Japanese sort order.
* Since ICU 50, this attribute is not settable any more via API functions.
*
* @return flag true if Hiragana Quaternary mode is on, false otherwise
* @see #setHiraganaQuaternaryDefault
* @see #setHiraganaQuaternary(boolean)
* @stable ICU 2.8
* @deprecated ICU 50 Implementation detail, cannot be set via API, might be removed from implementation.
*/
public boolean isHiraganaQuaternary() {
return m_isHiragana4_;

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
* Copyright (C) 2002-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
* Copyright (C) 2002-2012, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
@ -830,8 +830,8 @@ public class CollationAPITest extends TestFmwk {
errln("Setting french collation failed");
}
collator.setHiraganaQuaternary(!hquart);
if (collator.isHiraganaQuaternary() == hquart) {
errln("Setting hiragana quartenary failed");
if (collator.isHiraganaQuaternary() != hquart) {
errln("Setting hiragana quartenary worked but should be a no-op since ICU 50");
}
collator.setLowerCaseFirst(!lowercase);
if (collator.isLowerCaseFirst() == lowercase) {

View File

@ -1,7 +1,7 @@
/*
*******************************************************************************
* Copyright (C) 2002-2010, International Business Machines Corporation and *
* others. All Rights Reserved. *
* Copyright (C) 2002-2012, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*/
@ -172,8 +172,7 @@ public class CollationKanaTest extends TestFmwk{
int result;
String string1 = new String(tmp1);
String string2 = new String(tmp2);
RuleBasedCollator rb = (RuleBasedCollator)Collator.getInstance(ULocale.JAPAN);
rb.setHiraganaQuaternary(true);
RuleBasedCollator rb = (RuleBasedCollator)Collator.getInstance(ULocale.JAPANESE);
rb.setStrength(Collator.QUATERNARY);
rb.setAlternateHandlingShifted(false);