Class HistogramCSVGenerator
- All Implemented Interfaces:
Generator<Histogram>,TransformingGenerator<Histogram,,Histogram> ElementWriter<Histogram>
Writes a histogram to a CSV file.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIff true bins in the histogram with a zero count are not writtenvoidsetIgnoreZeros(boolean ignoreZeros) Iff true bins in the histogram with a zero count are not writtenvoidwriteToFile(Histogram 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
-
HistogramCSVGenerator
public HistogramCSVGenerator()
-
-
Method Details
-
writeToFile
public void writeToFile(Histogram 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<Histogram,Histogram> - 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.
-
isIgnoreZeros
public boolean isIgnoreZeros()Iff true bins in the histogram with a zero count are not written -
setIgnoreZeros
public void setIgnoreZeros(boolean ignoreZeros) Iff true bins in the histogram with a zero count are not written
-