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 TypeMethodDescriptionboolean
Iff true bins in the histogram with a zero count are not writtenvoid
setIgnoreZeros
(boolean ignoreZeros) Iff true bins in the histogram with a zero count are not writtenvoid
writeToFile
(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
selectFileExtension
Methods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transform
Methods 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:SingleFileTypeGenerator
Write 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:
writeToFile
in 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
-