Interface InputOutputContext

All Known Implementing Classes:
InputOutputContextStateful

public interface InputOutputContext
A context for performing input generally and outputting to a particular output-directory.
Author:
Owen Feehan
  • Method Details

    • getModelDirectory

      Path getModelDirectory()
      An input-directory in which models are stored.
      Returns:
      a path to the model-directory.
    • getOutputter

      Outputter getOutputter()
      An outputter that writes to the particular output-directory.
      Returns:
      the outputter.
    • isDebugEnabled

      boolean isDebugEnabled()
      Is debug-mode enabled?
      Returns:
      true iff debug-mode is enabled
    • getLogger

      Logger getLogger()
      The associated logger.
      Returns:
      the logger associated with input-output operations.
    • getExecutionTimeRecorder

      ExecutionTimeRecorder getExecutionTimeRecorder()
      Allows execution-times to be recorded for particular operations.
      Returns:
      the recorder.
    • common

      default CommonContext common()
      Creates a CommonContext a context that contains a subset of this context.
      Returns:
      a newly created CommonContext reusing the objects from this context.
    • getErrorReporter

      default ErrorReporter getErrorReporter()
      The associated error reporter.
      Returns:
      the error reporter
    • getMessageReporter

      default MessageLogger getMessageReporter()
      The associated message reporter.
      Returns:
      the message reporter
    • subdirectory

      default InputOutputContext subdirectory(String subdirectoryName, boolean inheritOutputRulesAndRecording)
      Creates a new context that writes instead to a subdirectory.
      Parameters:
      subdirectoryName - 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:
      newly created context
    • maybeSubdirectory

      default InputOutputContext maybeSubdirectory(Optional<String> subdirectoryName, boolean inheritOutputRulesAndRecording)
      Optionally creates a new context like with subdirectory(java.lang.String, boolean) but only if a directory-name is defined
      Parameters:
      subdirectoryName - if defined, a new context is created that writes into a subdirectory of this 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:
      either a newly created context, or the existing context
    • operationContext

      default OperationContext operationContext()
      Creates a OperationContext based upon the state in this class.
      Returns:
      a newly created OperationContext.