Class ElementOutputter
Object
org.anchoranalysis.io.output.writer.ElementOutputter
public class ElementOutputter extends Object
Outputs an element to the file-system.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description ElementOutputter(OutputterChecked outputter, ExecutionTimeRecorder executionTimeRecorder, Supplier<Optional<Logger>> logger) -
Method Summary
Modifier and Type Method Description OutputterCheckedderiveSubdirectory(String subdirectoryName, boolean inheritOutputRulesAndRecording)Derives a bound-output-manager for a (possibly newly created) subdirectory of the existing manager.ExecutionTimeRecordergetExecutionTimeRecorder()Records the execution time of particular operations.MultiLevelOutputEnabledgetOutputsEnabled()Which outputs are enabled or not enabled.OutputterCheckedgetOutputter()The outputter for writing the element.OutputWriteSettingsgetSettings()General settings for outputting.Optional<ImageFileFormat>getSuggestedFormatToWrite()A suggestion on what file-format to write.Optional<Logger>logger()The associated logger.PathmakeOutputPath(Optional<String> suffixWithoutExtension, String extension, String fallbackSuffix)Creates a full absolute path that completes the part of the path present in the outputter with an additional suffix.
-
Constructor Details
-
ElementOutputter
public ElementOutputter(OutputterChecked outputter, ExecutionTimeRecorder executionTimeRecorder, Supplier<Optional<Logger>> logger)
-
-
Method Details
-
deriveSubdirectory
public OutputterChecked deriveSubdirectory(String subdirectoryName, boolean inheritOutputRulesAndRecording)Derives a bound-output-manager for a (possibly newly created) subdirectory of the existing manager.- Parameters:
subdirectoryName- the subdirectory-name.inheritOutputRulesAndRecording- if true, the output rules and recording are inherited from the parent directory. if false, they are not, and all outputs are allowed and are unrecorded.- Returns:
- a bound-output-manager for the subdirectory.
-
makeOutputPath
public Path makeOutputPath(Optional<String> suffixWithoutExtension, String extension, String fallbackSuffix)Creates a full absolute path that completes the part of the path present in the outputter with an additional suffix.- Parameters:
suffixWithoutExtension- the suffix for the path (without any extension).extension- the file extension (without a leading period).fallbackSuffix- if neither aprefixis defined nor asuffix, then this provides a suffix to use so a file isn't only an extension.- Returns:
- a newly created absolute path, combining directory, prefix (if it exists), suffix and extension.
-
getSettings
General settings for outputting.- Returns:
- the settings.
-
getSuggestedFormatToWrite
A suggestion on what file-format to write.- Returns:
- a suggestion for the file-format, if known.
-
getOutputsEnabled
Which outputs are enabled or not enabled.- Returns:
- an interface that can be used to determine if an individual output is enabled.
-
logger
The associated logger.- Returns:
- the logger.
-
getOutputter
The outputter for writing the element. -
getExecutionTimeRecorder
Records the execution time of particular operations.
-