public class AbstractCodePointMapping extends Object implements SingleByteEncoding
NOT_FOUND_CODE_POINT
Constructor and Description |
---|
AbstractCodePointMapping(String name,
int[] table)
Main constructor.
|
AbstractCodePointMapping(String name,
int[] table,
String[] charNameMap)
Extended constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
buildFromTable(int[] table)
Builds the internal lookup structures based on a given table.
|
String[] |
getCharNameMap()
Returns the array of character names for this encoding.
|
short |
getCodePointForGlyph(String charName)
Returns the index of a character/glyph with the given name.
|
String |
getName()
Returns the encoding's name.
|
String |
getNameFromCodePoint(int idx) |
char[] |
getUnicodeCharMap()
Returns a character array with Unicode scalar values which can be used to map encoding
code points to Unicode values.
|
char |
getUnicodeForIndex(int idx)
Returns the main Unicode value that is associated with the given code point in the encoding.
|
char |
mapChar(char c)
Maps a Unicode character to a code point in the encoding.
|
String |
toString() |
public AbstractCodePointMapping(String name, int[] table)
name
- the name of the encodingtable
- the table ([code point, unicode scalar value]+) with the mappingpublic AbstractCodePointMapping(String name, int[] table, String[] charNameMap)
name
- the name of the encodingtable
- the table ([code point, unicode scalar value]+) with the mappingcharNameMap
- all character names in the encoding (a value of null will be converted
to ".notdef")protected void buildFromTable(int[] table)
table
- the table ([code point, unicode scalar value]+) with the mappingpublic String getName()
getName
in interface SingleByteEncoding
public final char mapChar(char c)
mapChar
in interface SingleByteEncoding
c
- the Unicode character to mappublic final char getUnicodeForIndex(int idx)
idx
- the code point in the encodingpublic final char[] getUnicodeCharMap()
getUnicodeCharMap
in interface SingleByteEncoding
public short getCodePointForGlyph(String charName)
charName
- the character namepublic String getNameFromCodePoint(int idx)
public String[] getCharNameMap()
getCharNameMap
in interface SingleByteEncoding
Copyright © 2022 Apache Software Foundation. All rights reserved.