*/
public static String toLowerCase(Locale locale, String str)
{
- return toLowerCase(ULocale.forLocale(locale), str);
- }
-
- /**
- * Returns the lowercase version of the argument string.
- * Casing is dependent on the argument locale and context-sensitive
- * @param locale which string is to be converted in
- * @param str source string to be performed on
- * @return lowercase version of the argument string
- * @stable ICU 3.2
- */
- public static String toLowerCase(ULocale locale, String str) {
// TODO: remove package path
if (str.length() <= 100) {
if (str.isEmpty()) {
}
}
+ /**
+ * Returns the lowercase version of the argument string.
+ * Casing is dependent on the argument locale and context-sensitive
+ * @param locale which string is to be converted in
+ * @param str source string to be performed on
+ * @return lowercase version of the argument string
+ * @stable ICU 3.2
+ */
+ public static String toLowerCase(ULocale locale, String str) {
+ return toLowerCase(locale.toLocale(), str);
+ }
+
private static String applyEdits(String str, StringBuilder replacementChars, Edits edits) {
if (!edits.hasChanges()) {
return str;
// License & terms of use: http://www.unicode.org/copyright.html#License
package com.ibm.icu.text;
+import java.util.Locale;
+
import com.ibm.icu.impl.UCaseProps;
import com.ibm.icu.lang.UCharacter;
-import com.ibm.icu.util.ULocale;
// TODO: issues/questions
-// - add java.util.Locale overloads when signatures are settled
// - optimizing strategies for unstyled text: stop after number of changes or length of replacement?
/**
* This function calls edits.reset() first. edits can be null.
* @return dest with the result string (or only changes) appended.
*
- * @see UCharacter#toLowerCase(ULocale, String)
+ * @see UCharacter#toLowerCase(Locale, String)
* @draft ICU 59
* @provisional This API might change or be removed in a future release.
*/
public static <A extends Appendable> A toLower(
- ULocale locale, int options, CharSequence src, A dest, Edits edits) {
+ Locale locale, int options, CharSequence src, A dest, Edits edits) {
if (locale == null) {
- locale = ULocale.getDefault();
+ locale = Locale.getDefault();
}
int caseLocale = UCaseProps.getCaseLocale(locale);
// TODO: remove package path
* This function calls edits.reset() first. edits can be null.
* @return dest with the result string (or only changes) appended.
*
- * @see UCharacter#toUpperCase(ULocale, String)
+ * @see UCharacter#toUpperCase(Locale, String)
* @draft ICU 59
* @provisional This API might change or be removed in a future release.
*/
public static <A extends Appendable> A toUpper(
- ULocale locale, int options, CharSequence src, A dest, Edits edits) {
+ Locale locale, int options, CharSequence src, A dest, Edits edits) {
return null;
}
* This function calls edits.reset() first. edits can be null.
* @return dest with the result string (or only changes) appended.
*
- * @see UCharacter#toTitleCase(ULocale, String, BreakIterator, int)
+ * @see UCharacter#toTitleCase(Locale, String, BreakIterator, int)
* @draft ICU 59
* @provisional This API might change or be removed in a future release.
*/
public static <A extends Appendable> A toTitle(
- ULocale locale, int options, BreakIterator iter,
+ Locale locale, int options, BreakIterator iter,
CharSequence src, A dest, Edits edits) {
return null;
}