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 FromFileReader
FromFileReader.Builder<F> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static booleannot null, not empty, not blank and not a comment (starts with '#')static TextLineReaderstatic TextLineReaderof(File file, OperatorWithException<InputStream> filter) static TextLineReaderstatic TextLineReaderof(InMemoryFile file) static TextLineReaderof(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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FromFileReader
drainTo, forEachInBacthes, iterator, map, streamMethods inherited from interface 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
-
of
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceFromFileReader<String>- Throws:
IOException
-
read
Description copied from interface:FromFileReaderReturning 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:
readin 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
-