Class FeatureResultsAndThumbnails

Object
FeatureResultsAndThumbnails

public class FeatureResultsAndThumbnails extends Object
A collection of results from feature calculation, and associated thumbnails.

It supports concurrent access by multiple threads.

The following outputs are produced:

Output NameDefault?Description
thumbnailsyesa small picture for each row in the features CSV illustrating its content.
Author:
Owen Feehan
  • Constructor Details

    • FeatureResultsAndThumbnails

      public FeatureResultsAndThumbnails(FeatureOutputMetadata outputMetadata, FeatureExporterContext context) throws OutputWriteFailedException
      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>, OperationFailedException> thumbnail) throws OperationFailedException
      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 OutputWriteFailedException
      Writes 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 a FeatureCSVWriterFactory for a particular InputOutputContext.
      context - the InputOutputContext for input/output operations.
      Throws:
      OutputWriteFailedException - if there's an error writing the output.
    • closeAnyOpenIO

      public void closeAnyOpenIO() throws IOException
      Closes any open IO and removes redundant structures stored in memory.
      Throws:
      IOException - if the close operation cannot successfully complete.