Package org.ojalgo.netio
Interface FromFileReader<T>
- All Superinterfaces:
AutoCloseable
,Closeable
,Iterable<T>
- All Known Implementing Classes:
DataReader
,ManagedReader
,MappedReader
,QueuedReader
,SequencedReader
,TextLineReader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
static void
copy
(File sourceFile, Properties destinationMap) Read the properties file and copy the entries to the supplied destinationProperties
instance.static void
Delete this file or directory (does not need to be empty).static <T extends Serializable>
Tdefault int
drainTo
(Collection<? super T> container, int maxElements) Behaves similar toBlockingQueue.drainTo(Collection, int)
except that returning 0 means there are no more items to read.static <T> FromFileReader
<T> empty()
default void
forEachInBacthes
(int batchSize, Consumer<? super T> action) Similar toIterable.forEach(Consumer)
but processes items in batches.static InputStream
static InputStream
input
(File file, OperatorWithException<InputStream> filter) iterator()
default <U> FromFileReader
<U> static <F> FromFileReader.Builder
<F> newBuilder
(F... file) static FromFileReader.Builder
<File> newBuilder
(File file) static FromFileReader.Builder
<Path> newBuilder
(Path file) newBuilder
(SegmentedFile segmented) static FromFileReader.Builder
<File> newBuilder
(ShardedFile sharded) read()
Returning null indicates that there are no more items to read.stream()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
copy
Read the properties file and copy the entries to the supplied destinationProperties
instance.- Parameters:
sourceFile
- Source properties filedestinationMap
- Destination properties map
-
delete
Delete this file or directory (does not need to be empty).- Parameters:
file
- Path to a file or directory to be deleted
-
deserializeObjectFromFile
-
empty
-
input
-
input
-
newBuilder
-
newBuilder
-
newBuilder
-
newBuilder
-
newBuilder
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
drainTo
Behaves similar toBlockingQueue.drainTo(Collection, int)
except that returning 0 means there are no more items to read. -
forEachInBacthes
Similar toIterable.forEach(Consumer)
but processes items in batches. Will extract up to batchSize items before calling the action, and then repeat until no more items are available. -
iterator
-
map
-
read
T read()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. -
stream
-