|
GXPARSE hosted by | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.gorman.util.scan.spi.AbstractReaderBuffer
public abstract class AbstractReaderBuffer
Input buffer factory to support a ScanBuffer
implementation on a java.io.Reader
.
The default implementation is expandable to hold character sequences of arbitrary length, within the limits imposed by the availability of free memory.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface ca.gorman.util.scan.InputControl |
---|
InputControl.Default |
Constructor Summary | |
---|---|
protected |
AbstractReaderBuffer(Reader reader)
|
Method Summary | |
---|---|
char |
charAt(int index)
|
int |
discard(int index)
Discard a leading prefix of characters from the buffer. |
boolean |
expand()
Increase the amount of data in the buffer, if the buffer supports expansion. |
int |
fill()
Make more characters available in a buffer with free space. |
int |
length()
|
static AbstractReaderBuffer |
newInstance(Reader reader)
|
CharSequence |
subSequence(int start,
int end)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractReaderBuffer(Reader reader) throws IOException
IOException
Method Detail |
---|
public static AbstractReaderBuffer newInstance(Reader reader) throws IOException
IOException
public char charAt(int index)
charAt
in interface CharSequence
public int length()
length
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public String toString()
toString
in interface CharSequence
toString
in class Object
public int discard(int index)
InputControl
Discard a leading prefix of characters from the buffer.
discard
in interface InputControl
index
- The number of characters to be discarded
public int fill() throws IOException
InputControl
Make more characters available in a buffer with free space.
fill
in interface InputControl
IOException
public boolean expand() throws IOException
Expandable
Increase the amount of data in the buffer, if the buffer supports expansion.
Expansion is not guaranteed, because the buffer may not support expansion or because the current state of the buffer (or its data source) may not permit expansion.
A successful expansion of a full buffer will increase the memory used by the buffer. A buffer with free space may simply add more data to the free space instead of acquiring and filling additional memory.
expand
in interface Expandable
IOException
|
GXPARSE download | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |