xjavadoc
Class JavaDocReader
java.lang.Object
java.io.Reader
java.io.FilterReader
xjavadoc.JavaDocReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
final class JavaDocReader
- extends java.io.FilterReader
A reader which strips away any spaces and stars at the beginning of javadoc.
It also keeps track of line numbers, which is needed for error reporting.
- Author:
- Aslak Helles�y
Fields inherited from class java.io.FilterReader |
in |
Fields inherited from class java.io.Reader |
lock |
Method Summary |
int |
available()
Returns the number of bytes that can be read without blocking. |
int |
getLineOffset()
Returns the line offset we're currently reading |
int |
read()
Reads a byte of data. |
int |
read(char[] b,
int off,
int len)
Reads into an array of bytes. |
long |
skip(long n)
Skips bytes of input. |
Methods inherited from class java.io.FilterReader |
close, mark, markSupported, ready, reset |
Methods inherited from class java.io.Reader |
read, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
badChar
private boolean badChar
endOfLine
private boolean endOfLine
c
private int c
lastC
private int lastC
atEnd
private boolean atEnd
_lineOffset
private int _lineOffset
nextChar
private int nextChar
JavaDocReader
public JavaDocReader(java.io.Reader in)
- Parameters:
in
- the underlying reader, containing javadoc
getLineOffset
public int getLineOffset()
- Returns the line offset we're currently reading
- Returns:
- line in the javadoc.
read
public int read()
throws java.io.IOException
- Reads a byte of data. The method will block if no input is available.
- Overrides:
read
in class java.io.FilterReader
- Returns:
- the byte read, or -1 if the end of the stream is
reached.
- Throws:
java.io.IOException
- If an I/O error has occurred.
read
public int read(char[] b,
int off,
int len)
throws java.io.IOException
- Reads into an array of bytes. Blocks until some input is available.
- Overrides:
read
in class java.io.FilterReader
- Parameters:
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
- Returns:
- the actual number of bytes read, -1 is returned when
the end of the stream is reached.
- Throws:
java.io.IOException
- If an I/O error has occurred.
skip
public long skip(long n)
throws java.io.IOException
- Skips bytes of input.
- Overrides:
skip
in class java.io.FilterReader
- Parameters:
n
- bytes to be skipped
- Returns:
- actual number of bytes skipped
- Throws:
java.io.IOException
- If an I/O error has occurred.
available
public int available()
throws java.io.IOException
- Returns the number of bytes that can be read without blocking.
- Returns:
- the number of available bytes
- Throws:
java.io.IOException
- Describe the exception