Package org.ojalgo.netio
Class TextLineReader
java.lang.Object
org.ojalgo.netio.TextLineReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<String>
,FromFileReader<String>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.ojalgo.netio.FromFileReader
FromFileReader.Builder<F>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static boolean
not null, not empty, not blank and not a comment (starts with '#')static TextLineReader
static TextLineReader
of
(File file, OperatorWithException<InputStream> filter) static TextLineReader
of
(InMemoryFile file) static TextLineReader
of
(InMemoryFile file, OperatorWithException<InputStream> filter) read()
Returning null indicates that there are no more items to read.<T> FromFileReader
<T> withFilteredParser
(Predicate<String> filter, TextLineReader.Parser<T> parser) The filter could for instance beisLineOK(String)
<T> FromFileReader
<T> withFilteredParser
(TextLineReader.Parser<T> parser) The filter isisLineOK(String)
<T> FromFileReader
<T> withParser
(TextLineReader.Parser<T> parser) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ojalgo.netio.FromFileReader
drainTo, forEachInBacthes, iterator, map, stream
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
myReader
-
-
Constructor Details
-
TextLineReader
-
TextLineReader
TextLineReader(Reader delegate)
-
-
Method Details
-
isLineOK
not null, not empty, not blank and not a comment (starts with '#') -
of
-
of
-
of
-
of
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFromFileReader<String>
- Throws:
IOException
-
read
Description copied from interface:FromFileReader
Returning null indicates that there are no more items to read. That's the same behaviour asBufferedReader.readLine()
. All implementations must return null precisely once.- Specified by:
read
in interfaceFromFileReader<String>
-
withFilteredParser
The filter isisLineOK(String)
-
withFilteredParser
public <T> FromFileReader<T> withFilteredParser(Predicate<String> filter, TextLineReader.Parser<T> parser) The filter could for instance beisLineOK(String)
-
withParser
-