info.informatica.text.mapper
Interface TextMapper

All Known Implementing Classes:
CombinedTextMapper, IdentityMapper, LeftMountMapper, LeftReplaceMapper, RegexpMapper, RegexpReplaceMapper, RightMountMapper, RightReplaceMapper, SingleTextMapper

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.

Version:
2.00
Author:
amengual at informatica dot info

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

init

void init(String initString)
          throws IOException,
                 MapperException
Deprecated. 

Initialize the mapper

Parameters:
initString - the String used to initialize the map
Throws:
IOException
MapperException

init

void init(Reader re)
          throws IOException,
                 MapperException
Initialize the mapper

Parameters:
re - the stream reader used to initialize the map
Throws:
IOException
MapperException

addMapping

void addMapping(String a,
                String b)
Adds a mapping rule between a and b


map

String map(String arg)
Maps arg to another String and returns it.

Parameters:
arg - the String to be mapped
Returns:
the String in the "Range Set" resulting from the map, or null if arg was not in the Domain Set (or if the mapping result was null itself).

map

String map(String arg,
           String unmatch)
Maps arg to another String and returns it.

Parameters:
arg - the String to be mapped
unmatch - the String to be returned if the argument does not match any mapping.
Returns:
the String in the "Range Set" resulting from the map, or unmatch if arg was not contained in the Domain Set, and the mapper therefore did not know how to map.

map

String map(String arg,
           String unmatch,
           String def)
Maps arg to another String and returns it.

Parameters:
arg - the String to be mapped
unmatch - 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.
Returns:
the String in the "Range Set" resulting from the map, or unmatch if arg was not contained in the Domain Set of the mapper, or def if the mapper returned null.