Package com.ibm.icu.impl
Class UCaseProps
- java.lang.Object
-
- com.ibm.icu.impl.UCaseProps
-
public final class UCaseProps extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceUCaseProps.ContextIteratorIterator for string case mappings, which need to look at the context (surrounding text) of a given character for conditional mappings.
-
Field Summary
Fields Modifier and Type Field Description static StringBuilderdummyStringBuilderstatic UCasePropsINSTANCEstatic intLOWERstatic intMAX_STRING_LENGTHFor string case mappings, a single character (a code point) is mapped either to itself (in which case in-place mapping functions do nothing), or to another single code point, or to a string.static intNONEstatic intTITLEstatic intTYPE_MASKstatic intUPPER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCaseClosure(int c, UnicodeSet set)Adds all simple case mappings and the full case folding for c to sa, and also adds special case closure mappings.voidaddPropertyStarts(UnicodeSet set)booleanaddStringCaseClosure(String s, UnicodeSet set)Maps the string to single code points and adds the associated case closure mappings.intfold(int c, int options)intgetDotType(int c)intgetType(int c)intgetTypeOrIgnorable(int c)booleanhasBinaryProperty(int c, int which)booleanisCaseSensitive(int c)booleanisSoftDotted(int c)inttoFullFolding(int c, StringBuilder out, int options)inttoFullLower(int c, UCaseProps.ContextIterator iter, StringBuilder out, ULocale locale, int[] locCache)Get the full lowercase mapping for c.inttoFullTitle(int c, UCaseProps.ContextIterator iter, StringBuilder out, ULocale locale, int[] locCache)inttoFullUpper(int c, UCaseProps.ContextIterator iter, StringBuilder out, ULocale locale, int[] locCache)inttolower(int c)inttotitle(int c)inttoupper(int c)
-
-
-
Field Detail
-
MAX_STRING_LENGTH
public static final int MAX_STRING_LENGTH
For string case mappings, a single character (a code point) is mapped either to itself (in which case in-place mapping functions do nothing), or to another single code point, or to a string. Aside from the string contents, these are indicated with a single int value as follows: Mapping to self: Negative values (~self instead of -self to support U+0000) Mapping to another code point: Positive values >MAX_STRING_LENGTH Mapping to a string: The string length (0..MAX_STRING_LENGTH) is returned. Note that the string result may indeed have zero length.- See Also:
- Constant Field Values
-
dummyStringBuilder
public static final StringBuilder dummyStringBuilder
-
TYPE_MASK
public static final int TYPE_MASK
- See Also:
- Constant Field Values
-
NONE
public static final int NONE
- See Also:
- Constant Field Values
-
LOWER
public static final int LOWER
- See Also:
- Constant Field Values
-
UPPER
public static final int UPPER
- See Also:
- Constant Field Values
-
TITLE
public static final int TITLE
- See Also:
- Constant Field Values
-
INSTANCE
public static final UCaseProps INSTANCE
-
-
Method Detail
-
addPropertyStarts
public final void addPropertyStarts(UnicodeSet set)
-
tolower
public final int tolower(int c)
-
toupper
public final int toupper(int c)
-
totitle
public final int totitle(int c)
-
addCaseClosure
public final void addCaseClosure(int c, UnicodeSet set)Adds all simple case mappings and the full case folding for c to sa, and also adds special case closure mappings. c itself is not added. For example, the mappings - for s include long s - for sharp s include ss - for k include the Kelvin sign
-
addStringCaseClosure
public final boolean addStringCaseClosure(String s, UnicodeSet set)
Maps the string to single code points and adds the associated case closure mappings. The string is mapped to code points if it is their full case folding string. In other words, this performs a reverse full case folding and then adds the case closure items of the resulting code points. If the string is found and its closure applied, then the string itself is added as well as part of its code points' closure.- Returns:
- true if the string was found
-
getType
public final int getType(int c)
- Returns:
- NONE, LOWER, UPPER, TITLE
-
getTypeOrIgnorable
public final int getTypeOrIgnorable(int c)
- Returns:
- same as ucase_getType() and set bit 2 if c is case-ignorable
-
getDotType
public final int getDotType(int c)
- Returns:
- NO_DOT, SOFT_DOTTED, ABOVE, OTHER_ACCENT
-
isSoftDotted
public final boolean isSoftDotted(int c)
-
isCaseSensitive
public final boolean isCaseSensitive(int c)
-
toFullLower
public final int toFullLower(int c, UCaseProps.ContextIterator iter, StringBuilder out, ULocale locale, int[] locCache)Get the full lowercase mapping for c.- Parameters:
c- Character to be mapped.iter- Character iterator, used for context-sensitive mappings. See ContextIterator for details. If iter==null then a context-independent result is returned.out- If the mapping result is a string, then it is appended to out.locale- Locale ID for locale-dependent mappings.locCache- Initialize locCache[0] to 0; may be used to cache the result of parsing the locale ID for subsequent calls. Can be null.- Returns:
- Output code point or string length, see MAX_STRING_LENGTH.
- See Also:
UCaseProps.ContextIterator,MAX_STRING_LENGTH
-
toFullUpper
public final int toFullUpper(int c, UCaseProps.ContextIterator iter, StringBuilder out, ULocale locale, int[] locCache)
-
toFullTitle
public final int toFullTitle(int c, UCaseProps.ContextIterator iter, StringBuilder out, ULocale locale, int[] locCache)
-
fold
public final int fold(int c, int options)
-
toFullFolding
public final int toFullFolding(int c, StringBuilder out, int options)
-
hasBinaryProperty
public final boolean hasBinaryProperty(int c, int which)
-
-