| Modifier and Type | Field and Description |
|---|---|
| private final int | longest
The length of the longest key in the lookupMap. |
| private final Map | lookupMap
The mapping to be used in translation. |
| private final BitSet | prefixSet
The first character of each key in the lookupMap. |
| private final int | shortest
The length of the shortest key in the lookupMap. |
| Access | Constructor and Description |
|---|---|
| public | LookupTranslator(final Map<CharSequence, CharSequence>
Map<CharSequence, CharSequence> table of translator mappings, may not be null. lookupMap)Constructs the lookup table to be used in translation. |
| Modifier and Type | Method and Description |
|---|---|
| public int | translate(final CharSequence input, final int index, final Writer writer)
Implements abstract org. Translate a set of code points, represented by an int index into a CharSequence, into another set of code points. |
| longest | back to summary |
|---|---|
| private final int longest The length of the longest key in the lookupMap. | |
| lookupMap | back to summary |
|---|---|
| private final Map<String, String> lookupMap The mapping to be used in translation. | |
| prefixSet | back to summary |
|---|---|
| private final BitSet prefixSet The first character of each key in the lookupMap. | |
| shortest | back to summary |
|---|---|
| private final int shortest The length of the shortest key in the lookupMap. | |
| LookupTranslator | back to summary |
|---|---|
| public LookupTranslator(final Map<CharSequence, CharSequence> lookupMap) Constructs the lookup table to be used in translation.
Note that, as of Lang 3.1 (the origin of this code), the key to the lookup table is converted to a
| |
| translate | back to summary |
|---|---|
| public int translate(final CharSequence input, final int index, final Writer writer) throws IOException Implements abstract org. Doc from org. Translate a set of code points, represented by an int index into a CharSequence, into another set of code points. The number of code points consumed must be returned, and the only IOExceptions thrown must be from interacting with the Writer so that the top level API may reliably ignore StringWriter IOExceptions.
| |