|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.Reader
org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetReader
public class LoopingAlphabetReader
A stream returning characters by looping over an alphabet.
| Field Summary | |
|---|---|
private CharAlphabet |
alphabet
The alphabet to draw letters from. |
private char[] |
buffer
Internal buffer of characters. |
private boolean |
closed
Tell if the reader is closed or not. |
private long |
length
Number of characters in the reader. |
private static int |
MAX_BUF_SIZE
Maximum size of buffer. |
private long |
remainingBlanks
Remaining blanks. |
private long |
remainingNonBlanks
Remaining non-blank characters. |
private static int |
SPACE
The character used for blanks (SPACE). |
private int |
trailingBlanks
Number of blanks at the end of stream. |
| Fields inherited from class java.io.Reader |
|---|
lock |
| Constructor Summary | |
|---|---|
LoopingAlphabetReader(long length)
Create a looping modern latin alphabet reader of the specified length. |
|
LoopingAlphabetReader(long length,
CharAlphabet alphabet)
Create a looping alphabet of the specified type and length. |
|
LoopingAlphabetReader(long length,
CharAlphabet alphabet,
int trailingBlanks)
Create a looping alphabet of the specified type and length, with the specified number of trailing blanks. |
|
LoopingAlphabetReader(long length,
int trailingBlanks)
Create a looping modern latin alphabet of the specified length, with the specified number of trailing blanks. |
|
| Method Summary | |
|---|---|
int |
available()
Return remaining characters in the stream. |
void |
close()
Close the reader. |
private void |
ensureOpen()
Ensure reader is open. |
private int |
fillBlanks(char[] buf,
int off,
int length)
Fill array with blanks (SPACE). |
private void |
fillBuffer(int bufSize)
Fill internal buffer of character sequence. |
int |
read()
|
int |
read(char[] buf,
int off,
int length)
|
void |
reset()
Reset the stream. |
| Methods inherited from class java.io.Reader |
|---|
mark, markSupported, read, read, ready, skip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int MAX_BUF_SIZE
private static final int SPACE
private final long length
private final int trailingBlanks
private long remainingNonBlanks
private long remainingBlanks
private char[] buffer
private final CharAlphabet alphabet
private boolean closed
| Constructor Detail |
|---|
public LoopingAlphabetReader(long length)
length - the number of characters
public LoopingAlphabetReader(long length,
int trailingBlanks)
length - trailingBlanks.
length - total number of characterstrailingBlanks - number of blank characters at the end
public LoopingAlphabetReader(long length,
CharAlphabet alphabet)
length - the number of chars in the readeralphabet - the alphabet to loop over
public LoopingAlphabetReader(long length,
CharAlphabet alphabet,
int trailingBlanks)
length - trailingBlanks.
length - total number of charactersalphabet - the alphabet to draw characters fromtrailingBlanks - number of blank characters at the end| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOException
public int read(char[] buf,
int off,
int length)
throws java.io.IOException
read in class java.io.Readerjava.io.IOException
public void reset()
throws java.io.IOException
reset in class java.io.Readerjava.io.IOExceptionpublic int available()
public void close()
close in interface java.io.Closeableclose in class java.io.Readerprivate void fillBuffer(int bufSize)
bufSize - the wanted size, might be ignored if too big
private int fillBlanks(char[] buf,
int off,
int length)
buf - array to filloff - starting offsetlength - maximum number of blanks to fill in
private final void ensureOpen()
throws java.io.IOException
java.io.IOException - if reader is closed
|
Built on Wed 2009-11-25 18:43:31-0800, from revision 884373 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||