本帖最后由 杨强 于 2011-12-22 09:48 编辑
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
public class MyLineNumberReader extends MyBufferedReader {
private int lineNumber;
public MyLineNumberReader(Reader reader) {
super(reader);
}
public int getLineNumber(){
return lineNumber;
}
public void setLineNumber(int lineNumber){
this.lineNumber=lineNumber;
}
public String readLine()throws IOException{
lineNumber++;
return super.readLine();
}
} |