SingleByteEncoding
public class SimpleSingleByteEncoding extends java.lang.Object implements SingleByteEncoding
NOT_FOUND_CODE_POINT
Constructor | Description |
---|---|
SimpleSingleByteEncoding(java.lang.String name) |
Main constructor.
|
Modifier and Type | Method | Description |
---|---|---|
char |
addCharacter(NamedCharacter ch) |
Adds a new character to the encoding.
|
NamedCharacter |
getCharacterForIndex(int codePoint) |
Returns the named character at a given code point in the encoding.
|
java.lang.String[] |
getCharNameMap() |
Returns the array of character names for this encoding.
|
int |
getFirstChar() |
Returns the index of the first defined character.
|
int |
getLastChar() |
Returns the index of the last defined character.
|
java.lang.String |
getName() |
Returns the encoding's name.
|
int |
getSize() |
Returns the number of characters defined by this encoding.
|
char[] |
getUnicodeCharMap() |
Returns a character array with Unicode scalar values which can be used to map encoding
code points to Unicode values.
|
boolean |
isFull() |
Indicates whether the encoding is full (with 256 code points).
|
char |
mapChar(char c) |
Maps a Unicode character to a code point in the encoding.
|
java.lang.String |
toString() |
public SimpleSingleByteEncoding(java.lang.String name)
name
- the encoding's namepublic java.lang.String getName()
getName
in interface SingleByteEncoding
public char mapChar(char c)
mapChar
in interface SingleByteEncoding
c
- the Unicode character to mappublic java.lang.String[] getCharNameMap()
getCharNameMap
in interface SingleByteEncoding
public int getFirstChar()
public int getLastChar()
public int getSize()
public boolean isFull()
public char addCharacter(NamedCharacter ch)
ch
- the named characterpublic NamedCharacter getCharacterForIndex(int codePoint)
codePoint
- the code point of the characterpublic char[] getUnicodeCharMap()
getUnicodeCharMap
in interface SingleByteEncoding
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 1999-2016 The Apache Software Foundation. All Rights Reserved.