Class BatchedObjectColumnProcessor
- java.lang.Object
-
- com.univocity.parsers.common.DefaultConversionProcessor
-
- com.univocity.parsers.common.processor.core.AbstractObjectProcessor<T>
-
- com.univocity.parsers.common.processor.core.AbstractBatchedObjectColumnProcessor<ParsingContext>
-
- com.univocity.parsers.common.processor.BatchedObjectColumnProcessor
-
- All Implemented Interfaces:
ConversionProcessor
,BatchedColumnReader<java.lang.Object>
,ColumnReader<java.lang.Object>
,Processor<ParsingContext>
,RowProcessor
public abstract class BatchedObjectColumnProcessor extends AbstractBatchedObjectColumnProcessor<ParsingContext> implements RowProcessor
ARowProcessor
implementation for converting batches of rows extracted from any implementation ofAbstractParser
into columns of objects.This uses the value conversions provided by
Conversion
instances.For each row processed, a sequence of conversions will be executed to generate the appropriate object. Each resulting object will then be stored in a list that contains the values of the corresponding column.
During the execution of the process, the
AbstractBatchedObjectColumnProcessor.batchProcessed(int)
method will be invoked after a given number of rows has been processed.The user can access the lists with values parsed for all columns using the methods
AbstractBatchedObjectColumnProcessor.getColumnValuesAsList()
,AbstractBatchedObjectColumnProcessor.getColumnValuesAsMapOfIndexes()
andAbstractBatchedObjectColumnProcessor.getColumnValuesAsMapOfNames()
.After
AbstractBatchedObjectColumnProcessor.batchProcessed(int)
is invoked, all values will be discarded and the next batch of column values will be accumulated. This process will repeat until there's no more rows in the input.
-
-
Field Summary
-
Fields inherited from class com.univocity.parsers.common.DefaultConversionProcessor
conversions
-
-
Constructor Summary
Constructors Constructor Description BatchedObjectColumnProcessor(int rowsPerBatch)
Constructs a batched column processor configured to invoke theAbstractBatchedObjectColumnProcessor.batchesProcessed
method after a given number of rows has been processed.
-
Method Summary
-
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractBatchedObjectColumnProcessor
batchProcessed, getBatchesProcessed, getColumn, getColumn, getColumn, getColumn, getColumnValuesAsList, getColumnValuesAsMapOfIndexes, getColumnValuesAsMapOfNames, getHeaders, getRowsPerBatch, processEnded, processStarted, putColumnValuesInMapOfIndexes, putColumnValuesInMapOfNames, rowProcessed
-
Methods inherited from class com.univocity.parsers.common.processor.core.AbstractObjectProcessor
rowProcessed
-
Methods inherited from class com.univocity.parsers.common.DefaultConversionProcessor
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingException
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.univocity.parsers.common.processor.RowProcessor
processEnded, processStarted, rowProcessed
-
-
-
-
Constructor Detail
-
BatchedObjectColumnProcessor
public BatchedObjectColumnProcessor(int rowsPerBatch)
Constructs a batched column processor configured to invoke theAbstractBatchedObjectColumnProcessor.batchesProcessed
method after a given number of rows has been processed.- Parameters:
rowsPerBatch
- the number of rows to process in each batch.
-
-