com.ibm.text
Interface SymbolTable
- public interface SymbolTable
An interface that maps strings to objects. This interface defines
both lookup protocol and parsing. This allows different components
to share a symbol table and to handle name parsing uniformly. It
is expected that client parse code look for the SYMBOL_REF
character and, when seen, attempt to parse the characters after it
using parseReference().
Currently, RuleBasedTransliterator and UnicodeSet use this
interface to share variable definitions.
Field Summary |
static char |
SYMBOL_REF
The character preceding a symbol reference name. |
Method Summary |
char[] |
lookup(java.lang.String s)
Lookup the characters associated with this string and return it. |
UnicodeMatcher |
lookupMatcher(int ch)
Lookup the UnicodeMatcher associated with the given character, and
return it. |
java.lang.String |
parseReference(java.lang.String text,
java.text.ParsePosition pos,
int limit)
Parse a symbol reference name from the given string, starting
at the given position. |
SYMBOL_REF
public static final char SYMBOL_REF
- The character preceding a symbol reference name.
lookup
public char[] lookup(java.lang.String s)
- Lookup the characters associated with this string and return it.
Return null if no such name exists. The resultant
array may have length zero.
lookupMatcher
public UnicodeMatcher lookupMatcher(int ch)
- Lookup the UnicodeMatcher associated with the given character, and
return it. Return null if not found.
- Parameters:
ch
- a 32-bit code point from 0 to 0x10FFFF.
parseReference
public java.lang.String parseReference(java.lang.String text,
java.text.ParsePosition pos,
int limit)
- Parse a symbol reference name from the given string, starting
at the given position. If no valid symbol reference name is
found, return null and leave pos unchanged.
- Parameters:
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.limit
- the index after the last character to be parsed.- Returns:
- the parsed name.
Copyright (c) 2001 IBM Corporation and others.