|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.derbyTesting.functionTests.util.streams.ByteAlphabet
public class ByteAlphabet
A looping alphabet, returning bytes in a specified encoding. The alphabet loops over a list of bytes representing characters. The alphabet-object is used by looping stream, which in turn is used for testing methods requiring streaming inputs. The following alphabets have been defined:
| Field Summary | |
|---|---|
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. |
| Constructor Summary | |
|---|---|
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. |
| Method Summary | |
|---|---|
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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
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 bytes| Method Detail |
|---|
public static ByteAlphabet modernLatinLowercase()
public static ByteAlphabet norwegianLowercase()
public static ByteAlphabet tamilUTF8()
public static ByteAlphabet tamilUTF16BE()
public static ByteAlphabet cjkSubsetUTF8()
public static ByteAlphabet cjkSubsetUTF16BE()
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 read
|
Built on Fri 2009-11-06 18:44:10-0800, from revision 833282 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||