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.
 UnicodeSet lookupSet(char ch)
          Lookup the UnicodeSet 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.
 

Field Detail

SYMBOL_REF

public static final char SYMBOL_REF
The character preceding a symbol reference name.
Method Detail

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.

lookupSet

public UnicodeSet lookupSet(char ch)
Lookup the UnicodeSet associated with the given character, and return it. Return null if not found.

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 name
pos - 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) 1998-2000 IBM Corporation and others.