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
Base class for a
Generator that outputs a feature-table in CSV format.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureTableCSVGenerator(List<String> headerNames) Creates a newFeatureTableCSVGeneratorinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidwriteFeaturesToCSV(CSVWriter writer, T allFeatureResults, List<String> headerNames) Writes the features to the CSV-file.voidwriteToFile(T element, OutputWriteSettings settings, Path filePath) Write generated content for {code element} to the filefilePath.Methods inherited from class org.anchoranalysis.io.generator.tabular.CSVGenerator
selectFileExtensionMethods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transformMethods inherited from class org.anchoranalysis.io.generator.SingleFileTypeGenerator
write, writeWithIndex
-
Constructor Details
-
FeatureTableCSVGenerator
Creates a newFeatureTableCSVGeneratorinstance.- 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:SingleFileTypeGeneratorWrite generated content for {code element} to the filefilePath.This function deliberately leaves ambiguity over what occurs if a file already exists at
filePath.- Specified by:
writeToFilein classSingleFileTypeGenerator<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 useallFeatureResults- all rows to writeheaderNames- header-names for columns, corresponding to the data inrows.- Throws:
OutputWriteFailedException- if the output cannot be written.
-