xjavadoc

Class JavaDocReader

final class JavaDocReader extends 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 Hellesxy

UNKNOWN: 3. januar 2002

Field Summary
booleanatEnd
booleanbadChar
intc
booleanendOfLine
intlastC
intnextChar
int_lineOffset
Constructor Summary
JavaDocReader(Reader in)
Method Summary
intavailable()
Returns the number of bytes that can be read without blocking.
intgetLineOffset()
Returns the line offset we're currently reading
intread()
Reads a byte of data.
intread(char[] b, int off, int len)
Reads into an array of bytes.
longskip(long n)
Skips bytes of input.

Field Detail

atEnd

private boolean atEnd

badChar

private boolean badChar

c

private int c

endOfLine

private boolean endOfLine

lastC

private int lastC

nextChar

private int nextChar

_lineOffset

private int _lineOffset

Constructor Detail

JavaDocReader

public JavaDocReader(Reader in)

Parameters: in the underlying reader, containing javadoc

Method Detail

available

public int available()
Returns the number of bytes that can be read without blocking.

Returns: the number of available bytes

Throws: IOException Describe the exception

getLineOffset

public int getLineOffset()
Returns the line offset we're currently reading

Returns: line in the javadoc.

read

public int read()
Reads a byte of data. The method will block if no input is available.

Returns: the byte read, or -1 if the end of the stream is reached.

Throws: IOException If an I/O error has occurred.

read

public int read(char[] b, int off, int len)
Reads into an array of bytes. Blocks until some input is available.

Parameters: b the buffer into which the data is read off the start offset of the data len 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: IOException If an I/O error has occurred.

skip

public long skip(long n)
Skips bytes of input.

Parameters: n bytes to be skipped

Returns: actual number of bytes skipped

Throws: IOException If an I/O error has occurred.