Package com.ibm.icu.impl
Class UCaseProps
java.lang.Object
com.ibm.icu.impl.UCaseProps
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Iterator 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 class
Fast case mapping data for ASCII/Latin. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final String
private static final String
private static final String
private static final int
private static final int
static final StringBuilder
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private String
private static final byte[]
private static final int
(package private) static final int
Bit 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 int
private static final String
private static final String
private static final String
private static final String
(package private) static final int
private int[]
static final UCaseProps
private static final String
private static final int
private static final int
private static final int
private static final int
private static final String
(package private) static final int
static final int
(package private) static final int
(package private) static final int
static final int
(package private) static final int
static final int
static final int
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.static final int
private static final int
private static final int
private static final int
static final int
private Trie2_16
static final int
private char[]
private static final int
private static final int
private static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.final void
final void
addSimpleCaseClosure
(int c, UnicodeSet set) final boolean
addStringCaseClosure
(String s, UnicodeSet set) Maps the string to single code points and adds the associated case closure mappings.final int
fold
(int c, int options) static final int
getCaseLocale
(ULocale locale) private static final int
getCaseLocale
(String language) Accepts both 2- and 3-letter language subtags.static final int
getCaseLocale
(Locale locale) (package private) static final int
getDelta
(int props) final int
getDotType
(int c) private static final int
getExceptionsOffset
(int props) private final int
getSlotValue
(int excWord, int index, int excOffset) private final long
getSlotValueAndOffset
(int excWord, int index, int excOffset) (package private) static Trie2_16
getTrie()
final int
getType
(int c) private static final int
getTypeAndIgnorableFromProps
(int props) (package private) static final int
getTypeFromProps
(int props) final int
getTypeOrIgnorable
(int c) final boolean
hasBinaryProperty
(int c, int which) private static final boolean
hasSlot
(int flags, int index) final boolean
isCaseSensitive
(int c) private final boolean
isFollowedByCasedLetter
(UCaseProps.ContextIterator iter, int dir) private final boolean
private final boolean
private final boolean
private final boolean
final boolean
isSoftDotted
(int c) (package private) static final boolean
isUpperOrTitleFromProps
(int props) (package private) static final boolean
propsHasException
(int props) private final void
readData
(ByteBuffer bytes) private static final byte
slotOffset
(int flags, int index) private final int
final int
toFullFolding
(int c, Appendable out, int options) final int
toFullLower
(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) Get the full lowercase mapping for c.final int
toFullTitle
(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) final int
toFullUpper
(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale) final int
tolower
(int c) final int
totitle
(int c) final int
toupper
(int c) private final int
toUpperOrTitle
(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) -
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)
-