|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TextMapper
A class implementing this interface maps Strings to other Strings, according to certain rules.
There are three Sets of interest in a text mapper: the Domain Set, the Unmatch Set, and the Range Set. The Input Set is comprised by all the input Strings that the mapper knows how to map to the Range Set using its rules. The Unmatch Set is the complementary Set formed by all the input Strings that the mapper is unable to map.
| Method Summary | |
|---|---|
void |
addMapping(String a,
String b)
Adds a mapping rule between a and b |
void |
init(Reader re)
Initialize the mapper |
void |
init(String initString)
Deprecated. |
String |
map(String arg)
Maps arg to another String and returns it. |
String |
map(String arg,
String unmatch)
Maps arg to another String and returns it. |
String |
map(String arg,
String unmatch,
String def)
Maps arg to another String and returns it. |
| Method Detail |
|---|
void init(String initString)
throws IOException,
MapperException
initString - the String used to initialize the map
IOException
MapperException
void init(Reader re)
throws IOException,
MapperException
re - the stream reader used to initialize the map
IOException
MapperException
void addMapping(String a,
String b)
String map(String arg)
arg to another String and returns it.
arg - the String to be mapped
null if arg was not in the Domain
Set (or if the mapping result was null itself).
String map(String arg,
String unmatch)
arg to another String and returns it.
arg - the String to be mappedunmatch - the String to be returned if the argument does not match any
mapping.
unmatch if arg was not contained in
the Domain Set, and the mapper therefore did not know how to map.
String map(String arg,
String unmatch,
String def)
arg to another String and returns it.
arg - the String to be mappedunmatch - the String to be returned if the argument does not match any
mapping.def - the value to be returned if the argument maps to null.
unmatch if arg was not contained in
the Domain Set of the mapper, or def if the mapper
returned null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||