Class FeatureTableCSVGenerator<T>

Object
SingleFileTypeGenerator<T,T>
OneStageGenerator<T>
CSVGenerator<T>
FeatureTableCSVGenerator<T>
Type Parameters:
T - type of object that describes all rows of feature calculations.
All Implemented Interfaces:
Generator<T>, TransformingGenerator<T,T>, ElementWriter<T>
Direct Known Subclasses:
AnnotationAggregateCSVGenerator

public abstract class FeatureTableCSVGenerator<T> extends CSVGenerator<T>
Base class for a Generator that outputs a feature-table in CSV format.
Author:
Owen Feehan
  • Constructor Details

    • FeatureTableCSVGenerator

      public FeatureTableCSVGenerator(List<String> headerNames)
      Creates a new FeatureTableCSVGenerator instance.
      Parameters:
      headerNames - The headers of all columns for the CSV output.
  • Method Details

    • writeToFile

      public void writeToFile(T element, OutputWriteSettings settings, Path filePath) throws OutputWriteFailedException
      Description copied from class: SingleFileTypeGenerator
      Write generated content for {code element} to the file filePath.

      This function deliberately leaves ambiguity over what occurs if a file already exists at filePath.

      Specified by:
      writeToFile in class SingleFileTypeGenerator<T,T>
      Parameters:
      element - element to be assigned and then transformed.
      settings - settings for outputting.
      filePath - the path to the file to write to.
      Throws:
      OutputWriteFailedException - if the content cannot be written successfully.
    • writeFeaturesToCSV

      protected abstract void writeFeaturesToCSV(CSVWriter writer, T allFeatureResults, List<String> headerNames) throws OutputWriteFailedException
      Writes the features to the CSV-file.
      Parameters:
      writer - the write to use
      allFeatureResults - all rows to write
      headerNames - header-names for columns, corresponding to the data in rows.
      Throws:
      OutputWriteFailedException - if the output cannot be written.