Package nl.rrd.wool.io
Class LineColumnNumberReader
- java.lang.Object
-
- java.io.Reader
-
- nl.rrd.wool.io.LineColumnNumberReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public class LineColumnNumberReader extends Reader
This buffered reader keeps track of the current line number and column number.
-
-
Constructor Summary
Constructors Constructor Description LineColumnNumberReader(Reader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearRestoreState(Object savedState)voidclose()intgetColNum()intgetLineNum()longgetPosition()ObjectgetRestoreState()ObjectgetRestoreState(int readAheadLimit)voidmark(int readAheadLimit)booleanmarkSupported()intread(char[] cbuf, int off, int len)booleanready()voidreinitRestoreState(Object state)voidreset()voidrestoreState(Object savedState)-
Methods inherited from class java.io.Reader
nullReader, read, read, read, skip, transferTo
-
-
-
-
Constructor Detail
-
LineColumnNumberReader
public LineColumnNumberReader(Reader reader)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
getPosition
public long getPosition()
-
getLineNum
public int getLineNum()
-
getColNum
public int getColNum()
-
read
public int read(char[] cbuf, int off, int len) throws IOException- Specified by:
readin classReader- Throws:
IOException
-
ready
public boolean ready() throws IOException- Overrides:
readyin classReader- Throws:
IOException
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classReader
-
mark
public void mark(int readAheadLimit) throws IOException- Overrides:
markin classReader- Throws:
IOException
-
reset
public void reset() throws IOException- Overrides:
resetin classReader- Throws:
IOException
-
getRestoreState
public Object getRestoreState()
-
getRestoreState
public Object getRestoreState(int readAheadLimit)
-
reinitRestoreState
public void reinitRestoreState(Object state)
-
clearRestoreState
public void clearRestoreState(Object savedState)
-
restoreState
public void restoreState(Object savedState) throws IOException
- Throws:
IOException
-
-