java.io.LineNumberReader (JDK 1.1)
This class is a character input stream that keeps track of the number of lines of text that have been read from it. It supports the usual Reader methods, and also the readLine() method introduced by its superclass. In addition to these methods, you can call getLineNumber() to query the number of lines set so far. You can also call setLineNumber() to set the line number for the current line. Subsequent lines are numbered sequentially from this specified starting point.
This class is a character-stream analog to LineNumberInputStream, which has been deprecated in Java 1.1.
public classLineNumberReaderextends BufferedReader { //Public ConstructorspublicLineNumberReader(Readerin); publicLineNumberReader(Readerin, intsz); //Public Instance Methodspublic intgetLineNumber(); public voidmark(intreadAheadLimit) throws IOException; //Overrides BufferedReaderpublic intread() throws IOException; //Overrides BufferedReaderpublic intread(char[]cbuf, intoff, intlen) throws IOException; //Overrides BufferedReaderpublic StringreadLine() throws IOException; //Overrides BufferedReaderpublic voidreset() throws IOException; //Overrides BufferedReaderpublic voidsetLineNumber(intlineNumber); public longskip(longn) throws IOException; //Overrides BufferedReader}
Hierarchy:
Object->Reader->BufferedReader->LineNumberReader