|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.xml.InputBuffer
This class represents a resizable input buffer.
Field Summary | |
protected char[] |
buffer
The current buffer. |
protected static int |
BUFFER_SIZE
The buffer size. |
protected int |
bufferIndex
The current buffer index. |
protected char[][] |
buffers
The buffers. |
protected int |
column
The column number. |
protected int |
count
The number of bytes in the current buffer. |
protected int |
current
The current character. |
protected int |
line
The line number. |
protected int |
mark
The current mark |
protected boolean |
markSet
Whether a mark is set. |
protected int |
position
The current position. |
protected java.io.Reader |
reader
The reader. |
protected int |
removedChars
The number of removed chars. |
Constructor Summary | |
InputBuffer(java.io.Reader r)
Creates a new InputBuffer object. |
Method Summary | |
int |
contentSize()
The size of the content of the buffer, ie. from the mark to the current position. |
int |
current()
Returns the current character or -1. |
int |
getColumn()
Returns the column of the current character. |
int |
getLine()
Returns the line of the current character. |
int |
next()
Go to the next character. |
protected void |
next(boolean preserve)
Go to the next character. |
void |
readContent(char[] a)
Returns the content of the buffer from the mark to the current position. |
void |
resetMark()
Resets a mark at the current position in the buffer. |
void |
setMark()
Sets a mark at the current position in the buffer. |
void |
unsetMark()
Unsets the current mark. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int BUFFER_SIZE
protected java.io.Reader reader
protected int bufferIndex
protected char[] buffer
protected char[][] buffers
protected int count
protected int position
protected int mark
protected boolean markSet
protected int current
protected int line
protected int column
protected int removedChars
Constructor Detail |
public InputBuffer(java.io.Reader r) throws java.io.IOException
r
- The reader used to read the document.Method Detail |
public int current()
public int getLine()
public int getColumn()
public int next() throws java.io.IOException
protected void next(boolean preserve) throws java.io.IOException
preserve
- true if the buffer must be preserved when a new
portion of the stream must be read.public void setMark()
java.lang.IllegalStateException
- if the mark was already set.public void resetMark()
public void unsetMark()
java.lang.IllegalStateException
- if the mark was not previously set.public int contentSize()
java.lang.IllegalStateException
- if the mark was not previously set.public void readContent(char[] a)
a
- The array to fill with the content of the buffer.java.lang.IllegalStateException
- if the mark was not previously set.java.lang.IllegalArgumentException
- if the given array is too small.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |