public class AbstractCodePointMapping extends java.lang.Object implements SingleByteEncoding
NOT_FOUND_CODE_POINT
Constructor and Description |
---|
AbstractCodePointMapping(java.lang.String name,
int[] table)
Main constructor.
|
AbstractCodePointMapping(java.lang.String name,
int[] table,
java.lang.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.
|
java.lang.String[] |
getCharNameMap()
Returns the array of character names for this encoding.
|
short |
getCodePointForGlyph(java.lang.String charName)
Returns the index of a character/glyph with the given name.
|
java.lang.String |
getName()
Returns the encoding's name.
|
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.
|
java.lang.String |
toString() |
public AbstractCodePointMapping(java.lang.String name, int[] table)
name
- the name of the encodingtable
- the table ([code point, unicode scalar value]+) with the mappingpublic AbstractCodePointMapping(java.lang.String name, int[] table, java.lang.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 java.lang.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(java.lang.String charName)
charName
- the character namepublic java.lang.String[] getCharNameMap()
getCharNameMap
in interface SingleByteEncoding
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.