Class FeatureResultsAndThumbnails
Object
FeatureResultsAndThumbnails
A collection of results from feature calculation, and associated thumbnails.
It supports concurrent access by multiple threads.
The following outputs are produced:
Output Name | Default? | Description |
---|---|---|
thumbnails | yes | a small picture for each row in the features CSV illustrating its content. |
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureResultsAndThumbnails
(FeatureOutputMetadata outputMetadata, FeatureExporterContext context) Creates a newFeatureResultsAndThumbnails
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(CheckedSupplier<LabelledResultsVector, OperationFailedException> resultToAdd, CheckedSupplier<Optional<DisplayStack>, OperationFailedException> thumbnail) Adds results, together with a thumbnail.void
Closes any open IO and removes redundant structures stored in memory.void
writeGroupedResults
(Optional<NamedFeatureStore<FeatureInputResults>> featuresAggregate, boolean includeGroups, Function<InputOutputContext, FeatureCSVWriterFactory> csvWriterCreator, InputOutputContext context) Writes all the results that have been collected as a CSV file.
-
Constructor Details
-
FeatureResultsAndThumbnails
public FeatureResultsAndThumbnails(FeatureOutputMetadata outputMetadata, FeatureExporterContext context) throws OutputWriteFailedException Creates a newFeatureResultsAndThumbnails
.- Parameters:
outputMetadata
- metadata for feature output.context
- the context for feature exporting operations.- Throws:
OutputWriteFailedException
- if there's an error setting up the output.
-
-
Method Details
-
add
public void add(CheckedSupplier<LabelledResultsVector, OperationFailedException> resultToAdd, CheckedSupplier<Optional<DisplayStack>, throws OperationFailedExceptionOperationFailedException> thumbnail) Adds results, together with a thumbnail.Note that in order for the sequence numbers to match the order in the feature table, a thumbnail should be present for all results, or for no results, but never partially.
The results are only calculated if any of the relevant outputs are enabled. Similarly with the thumbnails.
- Parameters:
resultToAdd
- supplies the results to add, which may or may not be called, depending on what outputs are enabled.thumbnail
- supplies the thumbnail to write, which may or may not be called, depending on what outputs are enabled.- Throws:
OperationFailedException
- if the operation cannot be successfully completed.
-
writeGroupedResults
public void writeGroupedResults(Optional<NamedFeatureStore<FeatureInputResults>> featuresAggregate, boolean includeGroups, Function<InputOutputContext, FeatureCSVWriterFactory> csvWriterCreator, InputOutputContext context) throws OutputWriteFailedExceptionWrites all the results that have been collected as a CSV file.- Parameters:
featuresAggregate
- features that can be used for generating additional "aggregated" exports.includeGroups
- if true a group-column is included in the CSV file and the group exports occur, otherwise not.csvWriterCreator
- creates aFeatureCSVWriterFactory
for a particularInputOutputContext
.context
- theInputOutputContext
for input/output operations.- Throws:
OutputWriteFailedException
- if there's an error writing the output.
-
closeAnyOpenIO
Closes any open IO and removes redundant structures stored in memory.- Throws:
IOException
- if the close operation cannot successfully complete.
-