|
22 | 22 |
|
23 | 23 | @Slf4j |
24 | 24 | public abstract class EbirdCsvParser |
25 | | -{ |
26 | | - public enum ParseMode {SINGLE_THREAD,MULTI_THREAD} |
27 | | - |
| 25 | +{ |
28 | 26 | public enum PreSort {NONE,DATE} |
29 | 27 |
|
30 | 28 | private static final DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("hh:mm a"); |
@@ -124,15 +122,13 @@ private static EbirdCsvRow parseCsvLine(CsvRecord record) |
124 | 122 | * |
125 | 123 | * @param csvFile The path to the CSV file to be parsed. Must not be {@code null}. |
126 | 124 | * @param rowProcessor A {@link Consumer} that processes each parsed row of the CSV file. The consumer receives an instance |
127 | | - * of {@link EbirdCsvRow}, which represents the parsed data of each row. Must not be {@code null}. |
128 | | - * @param mode The {@link ParseMode} specifying how the CSV file should be processed. {@link ParseMode#MULTI_THREAD} enables |
129 | | - * multi-threaded processing, while {@link ParseMode#SINGLE_THREAD} uses a single thread for processing. |
| 125 | + * of {@link EbirdCsvRow}, which represents the parsed data of each row. Must not be {@code null}. |
130 | 126 | * @param preSort Specifies the pre-sorting method to be applied to the CSV data before processing. If set to |
131 | 127 | * {@link PreSort#DATE}, the data will be sorted by observation date prior to processing; otherwise, the |
132 | 128 | * data is processed in the order it appears in the file. |
133 | 129 | * @throws IOException If an I/O error occurs while reading the CSV file. |
134 | 130 | */ |
135 | | - public static final void parseCsv(Path csvFile,Consumer<EbirdCsvRow> rowProcessor,ParseMode mode,PreSort preSort) throws IOException |
| 131 | + public static void parseCsv(Path csvFile,Consumer<EbirdCsvRow> rowProcessor,PreSort preSort) throws IOException |
136 | 132 | { |
137 | 133 | log.info("Parsing " + csvFile + " ..."); |
138 | 134 |
|
@@ -178,9 +174,9 @@ public void accept(CsvRecord record) |
178 | 174 | * @param rowProcessor The consumer function to be applied to each parsed CSV row. |
179 | 175 | * @throws IOException If an I/O error occurs while reading the CSV file. |
180 | 176 | */ |
181 | | - public static final void parseCsv(Path csvFile,Consumer<EbirdCsvRow> rowProcessor) throws IOException |
| 177 | + public static void parseCsv(Path csvFile,Consumer<EbirdCsvRow> rowProcessor) throws IOException |
182 | 178 | { |
183 | | - parseCsv(csvFile,rowProcessor,ParseMode.SINGLE_THREAD,PreSort.NONE); |
| 179 | + parseCsv(csvFile,rowProcessor,PreSort.NONE); |
184 | 180 | } |
185 | 181 |
|
186 | 182 | } |
0 commit comments