public abstract class Encoding extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,String> |
codeToName
This is a mapping from a character code to a character name.
|
protected Map<String,Integer> |
nameToCode
This is a mapping from a character name to a character code.
|
Constructor and Description |
---|
Encoding() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCharacterEncoding(int code,
String name)
This will add a character encoding.
|
Integer |
getCode(String name)
This will get the character code for the name.
|
Map<Integer,String> |
getCodeToNameMap()
Returns an unmodifiable view of the code to name mapping.
|
String |
getName(int code)
This will take a character code and get the name from the code.
|
protected Map<Integer,String> codeToName
protected void addCharacterEncoding(int code, String name)
code
- The character code that matches the character.name
- The name of the character.public Integer getCode(String name)
name
- The name of the character.public String getName(int code)
code
- The character code.Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.