public class AsciiCharacterTranslator extends java.lang.Object implements ICharacterTranslator
Constructor and Description |
---|
AsciiCharacterTranslator(java.lang.String[][] characterMap)
Creates and initializes a new translator that translates the provided
ASCII characters into strings.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
translate(char ch)
Translates the provided character into a string
|
public AsciiCharacterTranslator(java.lang.String[][] characterMap)
characterMap
- an array of pairs of strings.
Each pair consists of a key that must be a single ASCII character,
and a value that is its equivalent string.public java.lang.String translate(char ch)
ICharacterTranslator
translate
in interface ICharacterTranslator
ch
- the character to be translatedICharacterTranslator.translate(char)