Top Inners Fields Constructors Methods
com.ibm.icu.impl

public final Class UCaseProps

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.Iterator, .Locale, com.ibm.icu.lang.UCharacter, .UProperty, com.ibm.icu.text.UTF16, .UnicodeSet, com.ibm.icu.util.ICUUncheckedIOException, .ULocale

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
UCaseProps.ContextIterator

Iterator for string case mappings, which need to look at the context (surrounding text) of a given character for conditional mappings.

private static class
pack-priv static class
UCaseProps.LatinCase

Fast case mapping data for ASCII/Latin.

Field Summary

Modifier and TypeField and Description
private 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
public 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
pack-priv static final int
FOLD_CASE_OPTIONS_MASK

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
pack-priv static final int
private int[]
public 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
pack-priv static final int
public static final int
pack-priv static final int
pack-priv static final int
public static final int
pack-priv static final int
public static final int
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.

public static final int
private static final int
private static final int
private static final int
public static final int
private Trie2_16
public static final int
private char[]
private static final int
private static final int
private static final int
public static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
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.

public final void
public final void
public final boolean

Returns:

true if the string was found
addStringCaseClosure
(String s, UnicodeSet set)

Maps the string to single code points and adds the associated case closure mappings.

public final int
fold(int c, int options)

public static final int
public static final int
private static final int
getCaseLocale(String language)

Accepts both 2- and 3-letter language subtags.

pack-priv static final int
getDelta(int props)

public final int

Returns:

NO_DOT, SOFT_DOTTED, ABOVE, OTHER_ACCENT
getDotType
(int c)

private static final int
private final int
getSlotValue(int excWord, int index, int excOffset)

private final long
getSlotValueAndOffset(int excWord, int index, int excOffset)

pack-priv static Trie2_16
public final int

Returns:

NONE, LOWER, UPPER, TITLE
getType
(int c)

private static final int

Returns:

like getTypeFromProps() but also sets IGNORABLE if props indicate case-ignorable
getTypeAndIgnorableFromProps
(int props)

pack-priv static final int

Returns:

NONE, LOWER, UPPER, TITLE
getTypeFromProps
(int props)

public final int

Returns:

like getType() but also sets IGNORABLE if c is case-ignorable
getTypeOrIgnorable
(int c)

public final boolean
hasBinaryProperty(int c, int which)

private static final boolean
hasSlot(int flags, int index)

public final boolean
private final boolean
private final boolean
private final boolean
private final boolean
private final boolean
public final boolean
isSoftDotted(int c)

pack-priv static final boolean
pack-priv static final boolean
propsHasException(int props)

private final void
private static final byte
slotOffset(int flags, int index)

private final int
strcmpMax(String s, int unfoldOffset, int max)

public final int
toFullFolding(int c, Appendable out, int options)

public final int

Returns:

Output code point or string length, see MAX_STRING_LENGTH.
toFullLower
(int
Character to be mapped.
c
,
UCaseProps.ContextIterator
Character iterator, used for context-sensitive mappings. See ContextIterator for details. If iter==null then a context-independent result is returned.
iter
,
Appendable
If the mapping result is a string, then it is appended to out.
out
,
int
Case locale value from ucase_getCaseLocale().
caseLocale
)

Get the full lowercase mapping for c.

public final int
toFullTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale)

public final int
toFullUpper(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale)

public final int
tolower(int c)

public final int
totitle(int c)

public final int
toupper(int c)

private final int
toUpperOrTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int loc, boolean upperNotTitle)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ABOVEback to summary
private static final int ABOVE
CLOSURE_MAX_LENGTHback to summary
private static final int CLOSURE_MAX_LENGTH
DATA_FILE_NAMEback to summary
private static final String DATA_FILE_NAME
DATA_NAMEback to summary
private static final String DATA_NAME
DATA_TYPEback to summary
private static final String DATA_TYPE
DELTA_SHIFTback to summary
private static final int DELTA_SHIFT
DOT_MASKback to summary
private static final int DOT_MASK
dummyStringBuilderback to summary
public static final StringBuilder dummyStringBuilder
EXC_CLOSUREback to summary
private static final int EXC_CLOSURE
EXC_CONDITIONAL_FOLDback to summary
private static final int EXC_CONDITIONAL_FOLD
EXC_CONDITIONAL_SPECIALback to summary
private static final int EXC_CONDITIONAL_SPECIAL
EXC_DELTAback to summary
private static final int EXC_DELTA
EXC_DELTA_IS_NEGATIVEback to summary
private static final int EXC_DELTA_IS_NEGATIVE
EXC_DOT_SHIFTback to summary
private static final int EXC_DOT_SHIFT
EXC_DOUBLE_SLOTSback to summary
private static final int EXC_DOUBLE_SLOTS
EXC_FOLDback to summary
private static final int EXC_FOLD
EXC_FULL_MAPPINGSback to summary
private static final int EXC_FULL_MAPPINGS
EXC_LOWERback to summary
private static final int EXC_LOWER
EXC_NO_SIMPLE_CASE_FOLDINGback to summary
private static final int EXC_NO_SIMPLE_CASE_FOLDING
EXC_SENSITIVEback to summary
private static final int EXC_SENSITIVE
EXC_SHIFTback to summary
private static final int EXC_SHIFT
EXC_TITLEback to summary
private static final int EXC_TITLE
EXC_UPPERback to summary
private static final int EXC_UPPER
EXCEPTIONback to summary
private static final int EXCEPTION
exceptionsback to summary
private String exceptions
flagsOffsetback to summary
private static final byte[] flagsOffset
FMTback to summary
private static final int FMT
FOLD_CASE_OPTIONS_MASKback to summary
pack-priv static final int FOLD_CASE_OPTIONS_MASK

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). 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.

ICU Status
Internal ICU component.
FULL_LOWERback to summary
private static final int FULL_LOWER
iDotback to summary
private static final String iDot
iDotAcuteback to summary
private static final String iDotAcute
iDotGraveback to summary
private static final String iDotGrave
iDotTildeback to summary
private static final String iDotTilde
IGNORABLEback to summary
pack-priv static final int IGNORABLE
indexesback to summary
private int[] indexes
INSTANCEback to summary
public static final UCaseProps INSTANCE
iOgonekDotback to summary
private static final String iOgonekDot
IX_EXC_LENGTHback to summary
private static final int IX_EXC_LENGTH
IX_TOPback to summary
private static final int IX_TOP
IX_TRIE_SIZEback to summary
private static final int IX_TRIE_SIZE
IX_UNFOLD_LENGTHback to summary
private static final int IX_UNFOLD_LENGTH
jDotback to summary
private static final String jDot
LOC_ARMENIANback to summary
pack-priv static final int LOC_ARMENIAN
LOC_DUTCHback to summary
public static final int LOC_DUTCH
LOC_GREEKback to summary
pack-priv static final int LOC_GREEK
LOC_LITHUANIANback to summary
pack-priv static final int LOC_LITHUANIAN
LOC_ROOTback to summary
public static final int LOC_ROOT
LOC_TURKISHback to summary
pack-priv static final int LOC_TURKISH
LOWERback to summary
public static final int LOWER
MAX_STRING_LENGTHback to summary
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.

NONEback to summary
public static final int NONE
OTHER_ACCENTback to summary
private static final int OTHER_ACCENT
SENSITIVEback to summary
private static final int SENSITIVE
SOFT_DOTTEDback to summary
private static final int SOFT_DOTTED
TITLEback to summary
public static final int TITLE
trieback to summary
private Trie2_16 trie
TYPE_MASKback to summary
public static final int TYPE_MASK
unfoldback to summary
private char[] unfold
UNFOLD_ROW_WIDTHback to summary
private static final int UNFOLD_ROW_WIDTH
UNFOLD_ROWSback to summary
private static final int UNFOLD_ROWS
UNFOLD_STRING_WIDTHback to summary
private static final int UNFOLD_STRING_WIDTH
UPPERback to summary
public static final int UPPER

Constructor Detail

UCasePropsback to summary
private UCaseProps() throws IOException

Method Detail

addCaseClosureback to summary
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

addPropertyStartsback to summary
public final void addPropertyStarts(UnicodeSet set)
addSimpleCaseClosureback to summary
public final void addSimpleCaseClosure(int c, UnicodeSet set)
addStringCaseClosureback to summary
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:boolean

true if the string was found

foldback to summary
public final int fold(int c, int options)
getCaseLocaleback to summary
public static final int getCaseLocale(Locale locale)
getCaseLocaleback to summary
public static final int getCaseLocale(ULocale locale)
getCaseLocaleback to summary
private static final int getCaseLocale(String language)

Accepts both 2- and 3-letter language subtags.

getDeltaback to summary
pack-priv static final int getDelta(int props)
getDotTypeback to summary
public final int getDotType(int c)
Returns:int

NO_DOT, SOFT_DOTTED, ABOVE, OTHER_ACCENT

getExceptionsOffsetback to summary
private static final int getExceptionsOffset(int props)
getSlotValueback to summary
private final int getSlotValue(int excWord, int index, int excOffset)
getSlotValueAndOffsetback to summary
private final long getSlotValueAndOffset(int excWord, int index, int excOffset)
getTrieback to summary
pack-priv static Trie2_16 getTrie()
getTypeback to summary
public final int getType(int c)
Returns:int

NONE, LOWER, UPPER, TITLE

getTypeAndIgnorableFromPropsback to summary
private static final int getTypeAndIgnorableFromProps(int props)
Returns:int

like getTypeFromProps() but also sets IGNORABLE if props indicate case-ignorable

getTypeFromPropsback to summary
pack-priv static final int getTypeFromProps(int props)
Returns:int

NONE, LOWER, UPPER, TITLE

getTypeOrIgnorableback to summary
public final int getTypeOrIgnorable(int c)
Returns:int

like getType() but also sets IGNORABLE if c is case-ignorable

hasBinaryPropertyback to summary
public final boolean hasBinaryProperty(int c, int which)
hasSlotback to summary
private static final boolean hasSlot(int flags, int index)
isCaseSensitiveback to summary
public final boolean isCaseSensitive(int c)
isFollowedByCasedLetterback to summary
private final boolean isFollowedByCasedLetter(UCaseProps.ContextIterator iter, int dir)
isFollowedByDotAboveback to summary
private final boolean isFollowedByDotAbove(UCaseProps.ContextIterator iter)
isFollowedByMoreAboveback to summary
private final boolean isFollowedByMoreAbove(UCaseProps.ContextIterator iter)
isPrecededBy_Iback to summary
private final boolean isPrecededBy_I(UCaseProps.ContextIterator iter)
isPrecededBySoftDottedback to summary
private final boolean isPrecededBySoftDotted(UCaseProps.ContextIterator iter)
isSoftDottedback to summary
public final boolean isSoftDotted(int c)
isUpperOrTitleFromPropsback to summary
pack-priv static final boolean isUpperOrTitleFromProps(int props)
propsHasExceptionback to summary
pack-priv static final boolean propsHasException(int props)
readDataback to summary
private final void readData(ByteBuffer bytes) throws IOException
slotOffsetback to summary
private static final byte slotOffset(int flags, int index)
strcmpMaxback to summary
private final int strcmpMax(String s, int unfoldOffset, int max)
toFullFoldingback to summary
public final int toFullFolding(int c, Appendable out, int options)
toFullLowerback to summary
public final int toFullLower(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale)

Get the full lowercase mapping for c.

Parameters
c:int

Character to be mapped.

iter:UCaseProps.ContextIterator

Character iterator, used for context-sensitive mappings. See ContextIterator for details. If iter==null then a context-independent result is returned.

out:Appendable

If the mapping result is a string, then it is appended to out.

caseLocale:int

Case locale value from ucase_getCaseLocale().

Returns:int

Output code point or string length, see MAX_STRING_LENGTH.

ICU Status
Internal ICU component.
See Also
ContextIterator, MAX_STRING_LENGTH
toFullTitleback to summary
public final int toFullTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale)
toFullUpperback to summary
public final int toFullUpper(int c, UCaseProps.ContextIterator iter, Appendable out, int caseLocale)
tolowerback to summary
public final int tolower(int c)
totitleback to summary
public final int totitle(int c)
toupperback to summary
public final int toupper(int c)
toUpperOrTitleback to summary
private final int toUpperOrTitle(int c, UCaseProps.ContextIterator iter, Appendable out, int loc, boolean upperNotTitle)
com.ibm.icu.impl back to summary

public Interface UCaseProps.ContextIterator

Known Direct Implementers
com.ibm.icu.text.ReplaceableContextIterator, com.ibm.icu.impl.CaseMapImpl.StringContextIterator

Iterator for string case mappings, which need to look at the context (surrounding text) of a given character for conditional mappings. The iterator only needs to go backward or forward away from the character in question. It does not use any indexes on this interface. It does not support random access or an arbitrary change of iteration direction. The code point being case-mapped itself is never returned by this iterator.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

Next code point, or <0 when the iteration is done.
next
()

Iterate and return the next code point, moving in the direction determined by the reset() call.

public void
reset(int
>0: Begin iterating forward from the first code point after the one that is being case-mapped. <0: Begin iterating backward from the first code point before the one that is being case-mapped.
dir
)

Reset the iterator for forward or backward iteration.

Method Detail

nextback to summary
public int next()

Iterate and return the next code point, moving in the direction determined by the reset() call.

Returns:int

Next code point, or <0 when the iteration is done.

resetback to summary
public void reset(int dir)

Reset the iterator for forward or backward iteration.

Parameters
dir:int

>0: Begin iterating forward from the first code point after the one that is being case-mapped. <0: Begin iterating backward from the first code point before the one that is being case-mapped.

com.ibm.icu.impl back to summary

private final Class UCaseProps.IsAcceptable

extends Object
implements Authenticate
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.ICUBinary.Authenticate

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
isDataVersionAcceptable(byte[]
version of the current data
version
)

Implements com.ibm.icu.impl.ICUBinary.Authenticate.isDataVersionAcceptable.

Method used in ICUBinary.readHeader() to provide data format authentication.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IsAcceptableback to summary
private IsAcceptable()

Method Detail

isDataVersionAcceptableback to summary
public boolean isDataVersionAcceptable(byte[] version)

Implements com.ibm.icu.impl.ICUBinary.Authenticate.isDataVersionAcceptable.

Doc from com.ibm.icu.impl.ICUBinary.Authenticate.isDataVersionAcceptable.

Method used in ICUBinary.readHeader() to provide data format authentication.

Parameters
version:byte[]

version of the current data

Returns:boolean

true if dataformat is an acceptable version, false otherwise

Annotations
@Override
com.ibm.icu.impl back to summary

pack-priv final Class UCaseProps.LatinCase

extends Object
Class Inheritance

Fast case mapping data for ASCII/Latin. Linear arrays of delta bytes: 0=no mapping; EXC=exception. Deltas must not cross the ASCII boundary, or else they cannot be easily used in simple UTF-8 code.

Field Summary

Modifier and TypeField and Description
pack-priv static final byte
EXC

Exception: Complex mapping, or too-large delta.

pack-priv static final char
LIMIT

Case mapping/folding data for code points up to U+017F.

pack-priv static final char
LONG_S

U+017F case-folds and uppercases crossing the ASCII boundary.

pack-priv static final byte[]
TO_LOWER_NORMAL

Deltas for lowercasing for most locales, and default case folding.

pack-priv static final byte[]
TO_LOWER_TR_LT

Deltas for lowercasing for tr/az/lt, and Turkic case folding.

pack-priv static final byte[]
TO_UPPER_NORMAL

Deltas for uppercasing for most locales.

pack-priv static final byte[]
TO_UPPER_TR

Deltas for uppercasing for tr/az.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EXCback to summary
pack-priv static final byte EXC

Exception: Complex mapping, or too-large delta.

LIMITback to summary
pack-priv static final char LIMIT

Case mapping/folding data for code points up to U+017F.

LONG_Sback to summary
pack-priv static final char LONG_S

U+017F case-folds and uppercases crossing the ASCII boundary.

TO_LOWER_NORMALback to summary
pack-priv static final byte[] TO_LOWER_NORMAL

Deltas for lowercasing for most locales, and default case folding.

TO_LOWER_TR_LTback to summary
pack-priv static final byte[] TO_LOWER_TR_LT

Deltas for lowercasing for tr/az/lt, and Turkic case folding.

TO_UPPER_NORMALback to summary
pack-priv static final byte[] TO_UPPER_NORMAL

Deltas for uppercasing for most locales.

TO_UPPER_TRback to summary
pack-priv static final byte[] TO_UPPER_TR

Deltas for uppercasing for tr/az.

Constructor Detail

LatinCaseback to summary
pack-priv LatinCase()