Class ElementOutputter

Object
ElementOutputter

public class ElementOutputter extends Object
Outputs an element to the file-system.
Author:
Owen Feehan
  • Constructor Details

    • ElementOutputter

      public ElementOutputter(OutputterChecked outputter, ExecutionTimeRecorder executionTimeRecorder, Supplier<Optional<Logger>> logger)
      Creates a new ElementOutputter instance.
      Parameters:
      outputter - The outputter for writing the element.
      executionTimeRecorder - Records the execution time of particular operations.
      logger - Supplies a logger for information messages when outputting.
  • 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 a prefix is defined nor a suffix, 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

      public OutputWriteSettings getSettings()
      General settings for outputting.
      Returns:
      the settings.
    • getSuggestedFormatToWrite

      public Optional<ImageFileFormat> getSuggestedFormatToWrite()
      A suggestion on what file-format to write.
      Returns:
      a suggestion for the file-format, if known.
    • getOutputsEnabled

      public MultiLevelOutputEnabled getOutputsEnabled()
      Which outputs are enabled or not enabled.
      Returns:
      an interface that can be used to determine if an individual output is enabled.
    • logger

      public Optional<Logger> logger()
      The associated logger.
      Returns:
      the logger.
    • getOutputter

      public OutputterChecked getOutputter()
      The outputter for writing the element.
    • getExecutionTimeRecorder

      public ExecutionTimeRecorder getExecutionTimeRecorder()
      Records the execution time of particular operations.