本文整理汇总了Java中com.ibm.icu.lang.UCharacter.toUpperCase方法的典型用法代码示例。如果您正苦于以下问题:Java UCharacter.toUpperCase方法的具体用法?Java UCharacter.toUpperCase怎么用?Java UCharacter.toUpperCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.icu.lang.UCharacter
的用法示例。
在下文中一共展示了UCharacter.toUpperCase方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transform
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
public String transform(final String value) {
if (value == null) {
return null;
}
switch (mode) {
case UPPER_CASE:
return UCharacter.toUpperCase(value);
case LOWER_CASE:
return UCharacter.toLowerCase(value);
case CAPITALIZE_SENTENCES:
return UCharacter.toTitleCase(value, BreakIterator.getSentenceInstance());
case CAPITALIZE_WORDS:
return capitalizeWordsByDictionaries(value);
default:
throw new UnsupportedOperationException("Unsupported mode: " + mode);
}
}
示例2: addSourceTargetSet
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
@Override
public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) {
synchronized (this) {
if (sourceTargetUtility == null) {
sourceTargetUtility = new SourceTargetUtility(new Transform<String,String>() {
@Override
public String transform(String source) {
return UCharacter.toUpperCase(locale, source);
}
});
}
}
sourceTargetUtility.addSourceTargetSet(this, inputFilter, sourceSet, targetSet);
}
示例3: handleCase
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
* @param val
* string to be handled
* @param option
* to upper case or to lower case
* @return
*/
private String handleCase( String val, char option, ULocale locale )
{
if ( option == '<' )
return UCharacter.toLowerCase( locale, val );
else if ( option == '>' )
return UCharacter.toUpperCase( locale, val );
else
return val;
}
示例4: handleCase
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
* @param val
* string to be handled
* @param option
* to upper case or to lower case
* @return
*/
private String handleCase( String val, char option )
{
if ( option == '<' )
return UCharacter.toLowerCase( locale, val );
else if ( option == '>' )
return UCharacter.toUpperCase( locale, val );
else
return val;
}
示例5: toUpperCase
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
* Converts the characters in this string to uppercase, using the specified
* Locale.
*
* @param locale
* the Locale to use.
* @return a new string containing the uppercase characters equivalent to
* the characters in this string.
*/
public String toUpperCase(Locale locale) {
String result = UCharacter.toUpperCase(locale, this);
// Must return self if chars unchanged
if (count != result.count) {
return result;
}
for (int i = 0; i < count; i++) {
if (value[offset + i] != result.value[result.offset + i]) {
return result;
}
}
return this;
}
示例6: normalize
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
@Override
public String normalize(final String input) {
return UCharacter.toUpperCase(locale().asIcuLocale(), input);
}
示例7: toUpperCase
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
* Returns the upper case equivalent for the specified code point if the
* code point is a lower case letter. Otherwise, the specified code point is
* returned unchanged.
*
* @param codePoint
* the code point to convert.
* @return if {@code codePoint} is a lower case character then its upper
* case counterpart, otherwise just {@code codePoint}.
*/
public static int toUpperCase(int codePoint) {
return UCharacter.toUpperCase(codePoint);
}
示例8: toUpperCase
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
/**
* Answers the upper case equivalent for the character when the character is
* a lower case letter, otherwise answers the character.
*
* @param codePoint
* the character, including supplementary characters
* @return if codePoint is not an upper case character then its upper case
* counterpart, otherwise just codePoint
*/
public static int toUpperCase(int codePoint) {
return UCharacter.toUpperCase(codePoint);
}