Package com.ibm.icu.impl.coll
Class CollationRuleParser
java.lang.Object
com.ibm.icu.impl.coll.CollationRuleParser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface(package private) static enumSpecial reset positions.(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CollationDataprivate static final Stringprivate static final String[]private CollationRuleParser.Importerprivate Normalizer2private Normalizer2private static final int(package private) static final charBase for the second character of contractions that encode special reset positions.(package private) static final charFirst character of contractions that encode special reset positions.(package private) static final CollationRuleParser.Position[]private static final String[]private final StringBuilderprivate intprivate Stringprivate CollationSettingsprivate CollationRuleParser.Sinkprivate static final intprivate static final intUCOL_PRIMARY=0 ..private static final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringappendErrorContext(String reason) private static intstatic intgetReorderCode(String word) Gets a script or reorder code from its string representation.private static final booleanisSurrogate(int c) private static booleanisSyntaxChar(int c) ASCII [:P:] and [:S:]: [!-/ :-@ [-` {-~]private ParseExceptionmakeParseException(String reason) private void(package private) voidparse(String ruleString, CollationSettings outSettings) private intprivate voidparseRelationStrings(int strength, int i) private voidprivate intprivate voidprivate voidprivate intparseSpecialPosition(int i, StringBuilder str) Sets str to a contraction of U+FFFE and (U+2800 + Position).private voidparseStarredCharacters(int strength, int i) private intparseString(int i, StringBuilder raw) private intparseTailoringString(int i, StringBuilder raw) private intparseUnicodeSet(int i, UnicodeSet set) private intreadWords(int i, StringBuilder raw) (package private) voidsetImporter(CollationRuleParser.Importer importerAlias) Sets the pointer to an Importer object.private voidsetParseError(String reason) private voidsetParseError(String reason, Exception e) (package private) voidsetSink(CollationRuleParser.Sink sinkAlias) Sets the pointer to a Sink object.private intskipComment(int i) private intskipWhiteSpace(int i)
-
Field Details
-
POSITION_VALUES
-
POS_LEAD
static final char POS_LEADFirst character of contractions that encode special reset positions. U+FFFE cannot be tailored via rule syntax. The second contraction character is POS_BASE + Position.- See Also:
-
POS_BASE
static final char POS_BASEBase for the second character of contractions that encode special reset positions. Braille characters U+28xx are printable and normalization-inert.- See Also:
-
UCOL_DEFAULT
private static final int UCOL_DEFAULT- See Also:
-
UCOL_OFF
private static final int UCOL_OFF- See Also:
-
UCOL_ON
private static final int UCOL_ON- See Also:
-
STRENGTH_MASK
private static final int STRENGTH_MASKUCOL_PRIMARY=0 .. UCOL_IDENTICAL=15- See Also:
-
STARRED_FLAG
private static final int STARRED_FLAG- See Also:
-
OFFSET_SHIFT
private static final int OFFSET_SHIFT- See Also:
-
BEFORE
- See Also:
-
rawBuilder
-
positions
-
gSpecialReorderCodes
-
U_PARSE_CONTEXT_LEN
private static final int U_PARSE_CONTEXT_LEN- See Also:
-
nfd
-
nfc
-
rules
-
baseData
-
settings
-
sink
-
importer
-
ruleIndex
private int ruleIndex
-
-
Constructor Details
-
CollationRuleParser
CollationRuleParser(CollationData base) Constructor. The Sink must be set before parsing. The Importer can be set, otherwise [import locale] syntax is not supported.
-
-
Method Details
-
setSink
Sets the pointer to a Sink object. The pointer is aliased: Pointer copy without cloning or taking ownership. -
setImporter
Sets the pointer to an Importer object. The pointer is aliased: Pointer copy without cloning or taking ownership. -
parse
- Throws:
ParseException
-
parse
- Throws:
ParseException
-
parseRuleChain
- Throws:
ParseException
-
parseResetAndPosition
- Throws:
ParseException
-
parseRelationOperator
private int parseRelationOperator() -
parseRelationStrings
- Throws:
ParseException
-
parseStarredCharacters
- Throws:
ParseException
-
parseTailoringString
- Throws:
ParseException
-
parseString
- Throws:
ParseException
-
isSurrogate
private static final boolean isSurrogate(int c) -
parseSpecialPosition
Sets str to a contraction of U+FFFE and (U+2800 + Position).- Returns:
- rule index after the special reset position
- Throws:
ParseException
-
parseSetting
- Throws:
ParseException
-
parseReordering
- Throws:
ParseException
-
getReorderCode
Gets a script or reorder code from its string representation.- Returns:
- the script/reorder code, or -1 if not recognized
-
getOnOffValue
-
parseUnicodeSet
- Throws:
ParseException
-
readWords
-
skipComment
private int skipComment(int i) -
setParseError
- Throws:
ParseException
-
setParseError
- Throws:
ParseException
-
makeParseException
-
appendErrorContext
-
isSyntaxChar
private static boolean isSyntaxChar(int c) ASCII [:P:] and [:S:]: [!-/ :-@ [-` {-~] -
skipWhiteSpace
private int skipWhiteSpace(int i)
-