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 Summary
Modifier and TypeMethodDescriptiondefault CommonContext
common()
Creates aCommonContext
a context that contains a subset of this context.default ErrorReporter
The associated error reporter.Allows execution-times to be recorded for particular operations.The associated logger.default MessageLogger
The associated message reporter.An input-directory in which models are stored.An outputter that writes to the particular output-directory.boolean
Is debug-mode enabled?default InputOutputContext
maybeSubdirectory
(Optional<String> subdirectoryName, boolean inheritOutputRulesAndRecording) Optionally creates a new context like withsubdirectory(java.lang.String, boolean)
but only if a directory-name is defineddefault OperationContext
Creates aOperationContext
based upon the state in this class.default InputOutputContext
subdirectory
(String subdirectoryName, boolean inheritOutputRulesAndRecording) Creates a new context that writes instead to a subdirectory.
-
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
Creates aCommonContext
a context that contains a subset of this context.- Returns:
- a newly created
CommonContext
reusing the objects from this context.
-
getErrorReporter
The associated error reporter.- Returns:
- the error reporter
-
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 nameinheritOutputRulesAndRecording
- 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 withsubdirectory(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 nameinheritOutputRulesAndRecording
- 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
Creates aOperationContext
based upon the state in this class.- Returns:
- a newly created
OperationContext
.
-