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.
|
static String[] |
MAC_GLYPH_NAMES
The 258 standard mac glyph names a used in 'post' format 1 and 2.
|
static Map<String,Integer> |
MAC_GLYPH_NAMES_INDICES
The indices of the standard mac glyph names.
|
protected Map<String,Integer> |
nameToCode
This is a mapping from a character name to a character code.
|
static int |
NUMBER_OF_MAC_GLYPHS
The number of standard mac glyph names.
|
Constructor and Description |
---|
Encoding() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCharacterEncoding(int code,
String name)
This will add a character encoding.
|
String |
getCharacter(int code)
This will get the character from the code.
|
static String |
getCharacter(String name)
This will get the character from the name.
|
int |
getCode(String name)
This will get the character code for the name.
|
String |
getName(int code)
This will take a character code and get the name from the code.
|
String |
getNameFromCharacter(char c)
This will take a character code and get the name from the code.
|
public static final int NUMBER_OF_MAC_GLYPHS
public static final String[] MAC_GLYPH_NAMES
public static Map<String,Integer> MAC_GLYPH_NAMES_INDICES
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 int getCode(String name) throws IOException
name
- The name of the character.IOException
- If there is no character code for the name.public String getName(int code) throws IOException
code
- The character code.IOException
- If there is no name for the code.public String getNameFromCharacter(char c) throws IOException
c
- The character.IOException
- If there is no name for the character.public String getCharacter(int code) throws IOException
code
- The character code.IOException
- If there is not name for the character.Copyright © 2008–2018. All rights reserved.