|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface that defines both lookup protocol and parsing of symbolic names.
A symbol table maintains two kinds of mappings. The first is between symbolic names and their values. For example, if the variable with the name "start" is set to the value "alpha" (perhaps, though not necessarily, through an expression such as "$start=alpha"), then the call lookup("start") will return the char[] array ['a', 'l', 'p', 'h', 'a'].
The second kind of mapping is between character values and UnicodeMatcher objects. This is used by RuleBasedTransliterator, which uses characters in the private use area to represent objects such as UnicodeSets. If U+E015 is mapped to the UnicodeSet [a-z], then lookupMatcher(0xE015) will return the UnicodeSet [a-z].
Finally, a symbol table defines parsing behavior for symbolic names. All symbolic names start with the SYMBOL_REF character. When a parser encounters this character, it calls parseReference() with the position immediately following the SYMBOL_REF. The symbol table parses the name, if there is one, and returns it.
Field Summary | |
static char |
SYMBOL_REF
Deprecated. This is a draft API and might change in a future release of ICU. |
Method Summary | |
char[] |
lookup(String s)
Deprecated. This is a draft API and might change in a future release of ICU. |
UnicodeMatcher |
lookupMatcher(int ch)
Deprecated. This is a draft API and might change in a future release of ICU. |
String |
parseReference(String text,
ParsePosition pos,
int limit)
Deprecated. This is a draft API and might change in a future release of ICU. |
Field Detail |
public static final char SYMBOL_REF
Method Detail |
public char[] lookup(String s)
s
- the symbolic name to lookup
public UnicodeMatcher lookupMatcher(int ch)
ch
- a 32-bit code point from 0 to 0x10FFFF inclusive.
public String parseReference(String text, ParsePosition pos, int limit)
text
- the text to parse for the namepos
- on entry, the index of the first character to parse.
This is the character following the SYMBOL_REF character. On
exit, the index after the last parsed character. If the parse
failed, pos is unchanged on exit.limit
- the index after the last character to be parsed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |