Class DirectoryLinesStable
- All Implemented Interfaces:
LongFunction<String>
Read each line in each matching file in a directory structure, providing one line for each time this function is called. The files are sorted at the time the function is initialized, and each line is read in order.
This function accepts long input values, but they are used as ints, modulo the total number of lines known. This is due to historic limitations in the Java file APIs and file size support.
This is a variant of DirectoryLines. This version keeps a map of files and their respective cardinality,
computed at initialization time. The content is assumed to be static during the lifetime of this function.
The value returned for a given cycle is stable, so long as the underlying data is stable.
This caches all
data at initialization time. If you need to buffer the data in stream mode, use DirectoryLines instead,
which is not order-stable.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DirectoryLinesStable
-
-
Method Details
-
apply
- Specified by:
applyin interfaceLongFunction<String>
-
toString
-