patterntesting.runtime.io
Class LineReader

Package class diagram package LineReader
java.lang.Object
  extended by java.io.Reader
      extended by java.io.BufferedReader
          extended by patterntesting.runtime.io.LineReader
All Implemented Interfaces:
Closeable, Readable

public final class LineReader
extends BufferedReader

If extends BufferedReader but provides you the line number in which the reader is reading.

Since:
1.4 (13.11.2013)
Author:
oliver

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
LineReader(Reader in)
          Instantiates a new line reader.
LineReader(Reader in, int sz)
          Instantiates a new line reader.
 
Method Summary
 int getLineNumber()
          Gets the line number.
 int read()
          Read.
 int read(char[] arg0, int arg1, int arg2)
          Read.
 String readLine()
          Read line.
 void reset()
          Reset.
 long skip(long arg0)
          Skip.
 void skipLines(int n)
          Skip lines.
 
Methods inherited from class java.io.BufferedReader
close, mark, markSupported, ready
 
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
 

Constructor Detail

LineReader

public LineReader(Reader in)
Instantiates a new line reader.

Parameters:
in - the in

LineReader

public LineReader(Reader in,
                  int sz)
Instantiates a new line reader.

Parameters:
in - the in
sz - the sz
Method Detail

getLineNumber

public int getLineNumber()
Gets the line number.

Returns:
the line number

read

public int read()
         throws IOException
Read.

Overrides:
read in class BufferedReader
Returns:
the int
Throws:
IOException - Signals that an I/O exception has occurred.
See Also:
BufferedReader.read()

read

public int read(char[] arg0,
                int arg1,
                int arg2)
         throws IOException
Read.

Overrides:
read in class BufferedReader
Parameters:
arg0 - the arg0
arg1 - the arg1
arg2 - the arg2
Returns:
the int
Throws:
IOException - Signals that an I/O exception has occurred.
See Also:
BufferedReader.read(char[], int, int)

readLine

public String readLine()
                throws IOException
Read line.

Overrides:
readLine in class BufferedReader
Returns:
the string
Throws:
IOException - Signals that an I/O exception has occurred.
See Also:
BufferedReader.readLine()

reset

public void reset()
           throws IOException
Reset.

Overrides:
reset in class BufferedReader
Throws:
IOException - Signals that an I/O exception has occurred.
See Also:
BufferedReader.reset()

skip

public long skip(long arg0)
          throws IOException
Skip.

Overrides:
skip in class BufferedReader
Parameters:
arg0 - the arg0
Returns:
the long
Throws:
IOException - Signals that an I/O exception has occurred.
See Also:
BufferedReader.skip(long)

skipLines

public void skipLines(int n)
               throws IOException
Skip lines.

Parameters:
n - the number of lines to skip
Throws:
IOException - Signals that an I/O exception has occurred.


Copyright © 2002–2014 PatternTesting Team. All rights reserved.