Class UCaseProps
java.lang.Object
com.ibm.icu.impl.UCaseProps
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceIterator for string case mappings, which need to look at the context (surrounding text) of a given character for conditional mappings.private static final class(package private) static final classFast case mapping data for ASCII/Latin. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final Stringprivate static final Stringprivate static final Stringprivate static final intprivate static final intstatic final StringBuilderprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate Stringprivate static final byte[]private static final int(package private) static final intBit mask for getting just the options from a string compare options word that are relevant for case folding (of a single string or code point).private static final intprivate static final Stringprivate static final Stringprivate static final Stringprivate static final String(package private) static final intprivate int[]static final UCasePropsprivate static final Stringprivate static final intprivate static final intprivate static final intprivate static final intprivate static final String(package private) static final intstatic final int(package private) static final int(package private) static final intstatic final int(package private) static final intstatic final intstatic final intFor 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 final intprivate static final intprivate static final intprivate static final intstatic final intprivate Trie2_16static final intprivate char[]private static final intprivate static final intprivate static final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.final voidfinal voidaddSimpleCaseClosure(int c, UnicodeSet set) final booleanaddStringCaseClosure(String s, UnicodeSet set) Maps the string to single code points and adds the associated case closure mappings.final intfold(int c, int options) static final intgetCaseLocale(ULocale locale) private static final intgetCaseLocale(String language) Accepts both 2- and 3-letter language subtags.static final intgetCaseLocale(Locale locale) (package private) static final intgetDelta(int props) final intgetDotType(int c) private static final intgetExceptionsOffset(int props) private final intgetSlotValue(int excWord, int index, int excOffset) private final longgetSlotValueAndOffset(int excWord, int index, int excOffset) Get the value of an optional-value slot where hasSlot(excWord, index).(package private) static Trie2_16getTrie()final intgetType(int c) private static final intgetTypeAndIgnorableFromProps(int props) (package private) static final intgetTypeFromProps(int props) final intgetTypeOrIgnorable(int c) final booleanhasBinaryProperty(int c, int which) private static final booleanhasSlot(int flags, int index) final booleanisCaseSensitive(int c) private final booleanisFollowedByCasedLetter(UCaseProps.ContextIterator iter, int dir) private final booleanprivate final booleanprivate final booleanprivate final booleanfinal booleanisSoftDotted(int c) (package private) static final booleanisUpperOrTitleFromProps(int props) (package private) static final booleanpropsHasException(int props) private final voidreadData(ByteBuffer bytes) private static final byteslotOffset(int flags, int index) private final intfinal inttoFullFolding(int c, Appendable out, int options) final inttoFullLower(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) Get the full lowercase mapping for c.final inttoFullTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) final inttoFullUpper(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) final inttolower(int c) final inttotitle(int c) final inttoupper(int c) private final inttoUpperOrTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int loc, boolean upperNotTitle)
-
Field Details
-
flagsOffset
private static final byte[] flagsOffset -
MAX_STRING_LENGTH
public static final int MAX_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. 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:
-
LOC_ROOT
public static final int LOC_ROOT- See Also:
-
LOC_TURKISH
static final int LOC_TURKISH- See Also:
-
LOC_LITHUANIAN
static final int LOC_LITHUANIAN- See Also:
-
LOC_GREEK
static final int LOC_GREEK- See Also:
-
LOC_DUTCH
public static final int LOC_DUTCH- See Also:
-
LOC_ARMENIAN
static final int LOC_ARMENIAN- See Also:
-
iDot
- See Also:
-
jDot
- See Also:
-
iOgonekDot
- See Also:
-
iDotGrave
- See Also:
-
iDotAcute
- See Also:
-
iDotTilde
- See Also:
-
FOLD_CASE_OPTIONS_MASK
static final int FOLD_CASE_OPTIONS_MASKBit mask for getting just the options from a string compare options word that are relevant for case folding (of a single string or code point). Currently only bit 0 for FOLD_CASE_EXCLUDE_SPECIAL_I. It is conceivable that at some point we might use one more bit for using uppercase sharp s. It is conceivable that at some point we might want the option to use only simple case foldings when operating on strings.- See Also:
-
dummyStringBuilder
-
indexes
private int[] indexes -
exceptions
-
unfold
private char[] unfold -
trie
-
DATA_NAME
- See Also:
-
DATA_TYPE
- See Also:
-
DATA_FILE_NAME
- See Also:
-
FMT
private static final int FMT- See Also:
-
IX_TRIE_SIZE
private static final int IX_TRIE_SIZE- See Also:
-
IX_EXC_LENGTH
private static final int IX_EXC_LENGTH- See Also:
-
IX_UNFOLD_LENGTH
private static final int IX_UNFOLD_LENGTH- See Also:
-
IX_TOP
private static final int IX_TOP- See Also:
-
TYPE_MASK
public static final int TYPE_MASK- See Also:
-
NONE
public static final int NONE- See Also:
-
LOWER
public static final int LOWER- See Also:
-
UPPER
public static final int UPPER- See Also:
-
TITLE
public static final int TITLE- See Also:
-
IGNORABLE
static final int IGNORABLE- See Also:
-
EXCEPTION
private static final int EXCEPTION- See Also:
-
SENSITIVE
private static final int SENSITIVE- See Also:
-
DOT_MASK
private static final int DOT_MASK- See Also:
-
SOFT_DOTTED
private static final int SOFT_DOTTED- See Also:
-
ABOVE
private static final int ABOVE- See Also:
-
OTHER_ACCENT
private static final int OTHER_ACCENT- See Also:
-
DELTA_SHIFT
private static final int DELTA_SHIFT- See Also:
-
EXC_SHIFT
private static final int EXC_SHIFT- See Also:
-
EXC_LOWER
private static final int EXC_LOWER- See Also:
-
EXC_FOLD
private static final int EXC_FOLD- See Also:
-
EXC_UPPER
private static final int EXC_UPPER- See Also:
-
EXC_TITLE
private static final int EXC_TITLE- See Also:
-
EXC_DELTA
private static final int EXC_DELTA- See Also:
-
EXC_CLOSURE
private static final int EXC_CLOSURE- See Also:
-
EXC_FULL_MAPPINGS
private static final int EXC_FULL_MAPPINGS- See Also:
-
EXC_DOUBLE_SLOTS
private static final int EXC_DOUBLE_SLOTS- See Also:
-
EXC_NO_SIMPLE_CASE_FOLDING
private static final int EXC_NO_SIMPLE_CASE_FOLDING- See Also:
-
EXC_DELTA_IS_NEGATIVE
private static final int EXC_DELTA_IS_NEGATIVE- See Also:
-
EXC_SENSITIVE
private static final int EXC_SENSITIVE- See Also:
-
EXC_DOT_SHIFT
private static final int EXC_DOT_SHIFT- See Also:
-
EXC_CONDITIONAL_SPECIAL
private static final int EXC_CONDITIONAL_SPECIAL- See Also:
-
EXC_CONDITIONAL_FOLD
private static final int EXC_CONDITIONAL_FOLD- See Also:
-
FULL_LOWER
private static final int FULL_LOWER- See Also:
-
CLOSURE_MAX_LENGTH
private static final int CLOSURE_MAX_LENGTH- See Also:
-
UNFOLD_ROWS
private static final int UNFOLD_ROWS- See Also:
-
UNFOLD_ROW_WIDTH
private static final int UNFOLD_ROW_WIDTH- See Also:
-
UNFOLD_STRING_WIDTH
private static final int UNFOLD_STRING_WIDTH- See Also:
-
INSTANCE
-
-
Constructor Details
-
UCaseProps
- Throws:
IOException
-
-
Method Details
-
readData
- Throws:
IOException
-
addPropertyStarts
-
getExceptionsOffset
private static final int getExceptionsOffset(int props) -
propsHasException
static final boolean propsHasException(int props) -
hasSlot
private static final boolean hasSlot(int flags, int index) -
slotOffset
private static final byte slotOffset(int flags, int index) -
getSlotValueAndOffset
private final long getSlotValueAndOffset(int excWord, int index, int excOffset) Get the value of an optional-value slot where hasSlot(excWord, index).- Parameters:
excWord- (in) initial exceptions wordindex- (in) desired slot indexexcOffset- (in) offset into exceptions[] after excWord=exceptions.charAt(excOffset++);- Returns:
- bits 31..0: slot value 63..32: modified excOffset, moved to the last char of the value, use +1 for beginning of next slot
-
getSlotValue
private final int getSlotValue(int excWord, int index, int excOffset) -
tolower
public final int tolower(int c) -
toupper
public final int toupper(int c) -
totitle
public final int totitle(int c) -
addCaseClosure
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 -
addSimpleCaseClosure
-
strcmpMax
-
addStringCaseClosure
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:
- like getType() but also sets IGNORABLE 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) -
getCaseLocale
-
getCaseLocale
-
getCaseLocale
Accepts both 2- and 3-letter language subtags. -
isFollowedByCasedLetter
-
isPrecededBySoftDotted
-
isPrecededBy_I
-
isFollowedByMoreAbove
-
isFollowedByDotAbove
-
toFullLower
public final int toFullLower(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) 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.caseLocale- Case locale value from ucase_getCaseLocale().- Returns:
- Output code point or string length, see MAX_STRING_LENGTH.
- See Also:
-
toUpperOrTitle
private final int toUpperOrTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int loc, boolean upperNotTitle) -
toFullUpper
public final int toFullUpper(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) -
toFullTitle
public final int toFullTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) -
fold
public final int fold(int c, int options) -
toFullFolding
-
hasBinaryProperty
public final boolean hasBinaryProperty(int c, int which) -
getTrie
-
getTypeFromProps
static final int getTypeFromProps(int props) - Returns:
- NONE, LOWER, UPPER, TITLE
-
getTypeAndIgnorableFromProps
private static final int getTypeAndIgnorableFromProps(int props) - Returns:
- like getTypeFromProps() but also sets IGNORABLE if props indicate case-ignorable
-
isUpperOrTitleFromProps
static final boolean isUpperOrTitleFromProps(int props) -
getDelta
static final int getDelta(int props)
-