Package org.orekit.data
Class LineOrientedFilteringReader
- java.lang.Object
-
- java.io.Reader
-
- org.orekit.data.LineOrientedFilteringReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
public abstract class LineOrientedFilteringReader extends Reader
Base class for implementing line-oriented data filtering readers.This reader is intended to be used in
DataFilter.- Since:
- 12.1
- Author:
- Luc Maisonobe
-
-
Constructor Summary
Constructors Constructor Description LineOrientedFilteringReader(String name, Reader input)Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract CharSequencefilterLine(int lineNumber, String originalLine)Filter one line.protected BufferedReadergetBufferedReader()Get the underlying line-oriented reader.intread(char[] b, int offset, int len)-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
LineOrientedFilteringReader
public LineOrientedFilteringReader(String name, Reader input) throws IOException
Simple constructor.- Parameters:
name- file nameinput- underlying raw stream- Throws:
IOException- if first lines cannot be read
-
-
Method Detail
-
getBufferedReader
protected BufferedReader getBufferedReader()
Get the underlying line-oriented reader.- Returns:
- underlying line-oriented reader
-
read
public int read(char[] b, int offset, int len) throws IOException- Specified by:
readin classReader- Throws:
IOException
-
filterLine
protected abstract CharSequence filterLine(int lineNumber, String originalLine) throws IOException
Filter one line.- Parameters:
lineNumber- line numberoriginalLine- original line- Returns:
- filtered line
- Throws:
IOException- if line cannot be parsed
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
-