public class ByteAlphabet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
boff
Offset into the byte array.
|
private int |
byteCount
The number of byes in the alphabet.
|
private byte[] |
bytes
The bytes representing the characters in the alphabet.
|
private int |
charCount
The number of characters in the alphabet.
|
private java.lang.String |
encoding
The encoding used to represent characters as bytes.
|
private java.lang.String |
name
The name of the alphabet.
|
Modifier | Constructor and Description |
---|---|
private |
ByteAlphabet(java.lang.String name,
char[] chars,
java.lang.String encoding)
Create an alphabet with the given name, the given characters and using
the specified encoding to represent the characters as bytes.
|
Modifier and Type | Method and Description |
---|---|
int |
byteCount()
Return the number of bytes in the alphabet.
|
int |
charCount()
Return the number of characters in the alphabet.
|
static ByteAlphabet |
cjkSubsetUTF16BE()
Create an alphabet returning bytes representing a subset of the CJK
alphabet in the UTF-16BE encoding.
|
static ByteAlphabet |
cjkSubsetUTF8()
Create an alphabet returning bytes representing a subset of the CJK
alphabet in the UTF-8 encoding.
|
java.lang.String |
getEncoding()
Return the encoding used to represent characters as bytes.
|
java.lang.String |
getName()
Return the name of the alphabet.
|
static ByteAlphabet |
modernLatinLowercase()
Create an alphabet returning bytes representing the lowercase letters
a-z in the "US-ASCII" encoding.
|
byte |
nextByte()
Return the next byte in the alphabet.
|
int |
nextByteToRead(int bytesRead)
Compute the next byte to read after reading the specified number
of bytes.
|
static ByteAlphabet |
norwegianLowercase()
Create an alphabet returning bytes representing the 29 lowercase
letters in the Norwegian/Danish alphabet in the "ISO-8859-1" encoding.
|
void |
reset()
Reset the alphabet, the next byte returned is the first byte in the
alphabet, which might not be a complete character.
|
static ByteAlphabet |
singleByte(byte b)
Create an alphabet that consists of a single byte.
|
static ByteAlphabet |
tamilUTF16BE()
Create an alphabet returning bytes representing a subset of the Tamil
alphabet in the UTF-16BE encoding.
|
static ByteAlphabet |
tamilUTF8()
Create an alphabet returning bytes representing a subset of the Tamil
alphabet in the UTF-8 encoding.
|
private final java.lang.String name
private final java.lang.String encoding
private final byte[] bytes
private final int charCount
private final int byteCount
private int boff
private ByteAlphabet(java.lang.String name, char[] chars, java.lang.String encoding)
name
- the name of the alphabetchars
- the characters in the alphabetencoding
- the encoding to use to represent characters as bytespublic static ByteAlphabet modernLatinLowercase()
public static ByteAlphabet norwegianLowercase()
public static ByteAlphabet tamilUTF8()
public static ByteAlphabet tamilUTF16BE()
public static ByteAlphabet cjkSubsetUTF8()
public static ByteAlphabet cjkSubsetUTF16BE()
public static ByteAlphabet singleByte(byte b)
public java.lang.String getName()
public java.lang.String getEncoding()
public int charCount()
public int byteCount()
public byte nextByte()
public void reset()
public int nextByteToRead(int bytesRead)
bytesRead
- the number of bytes readApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.