public class SingleLookupTranslator extends CharSequenceTranslator
Constructor and Description |
---|
SingleLookupTranslator(Map<CharSequence,CharSequence>... inputMaps)
Define the look tables to be used in translation.
|
Modifier and Type | Method and Description |
---|---|
int |
translate(CharSequence input,
int index,
Writer out)
Translate a set of codepoints, represented by an int index into a CharSequence,
into another set of codepoints.
|
hex, translate, translate, with
public SingleLookupTranslator(Map<CharSequence,CharSequence>... inputMaps)
Note that, as of Lang 3.1, the key to the lookup table is converted to a java.lang.String. This is because we need the key to support hashCode and equals(Object), allowing it to be the key for a HashMap. See LANG-882.
Also note that, multiple lookup tables should be passed to this translator instead of passing multiple instances of this translator to the AggregateTranslator. Because, this translator only checks the values of the lookup table passed to this instance while deciding whether a value is already translated or not.
inputMaps,
- an array of Map<CharSequence, CharSequence>.public int translate(CharSequence input, int index, Writer out) throws IOException
translate
in class CharSequenceTranslator
input
- CharSequence that is being translatedindex
- int representing the current point of translationout
- Writer to translate the text toIOException
- if and only if the Writer produces an IOExceptionCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.