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 void
close()
protected abstract CharSequence
filterLine(int lineNumber, String originalLine)
Filter one line.protected BufferedReader
getBufferedReader()
Get the underlying line-oriented reader.int
read(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:
read
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
-