Class RecordingWriters
Object
org.anchoranalysis.io.output.recorded.RecordingWriters
public class RecordingWriters extends Object
Two writers that record any output-names that are passed as arguments.
The two writers are:
- A
CheckIfAllowedthat selectively outputs certain output-names. - A
AlwaysAllowedthat allows all output-names.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description RecordingWriters(ElementOutputter outputter, Optional<WriterExecuteBeforeEveryOperation> preop, Optional<MultiLevelRecordedOutputs> recordedOutputs)Creates the two writers. -
Method Summary
Modifier and Type Method Description Writermultiplex(boolean selectSelective)Multiplexes between theselectiveandpermissivewriters based on a flag.Writerpermissive()A writer that allows all output-names, and records the written output-names.Optional<MultiLevelRecordedOutputs>recordedOutputs()If defined, all output-names that are passed as arguments to both writers are recorded here.WritersecondLevel(String outputNameFirstLevel)A writer that performs a second-level check on which outputs occur, but writes to the top-level directory.Writerselective()A writer that allows only certain selected output-names, and records the written output-names.
-
Constructor Details
-
RecordingWriters
public RecordingWriters(ElementOutputter outputter, Optional<WriterExecuteBeforeEveryOperation> preop, Optional<MultiLevelRecordedOutputs> recordedOutputs)Creates the two writers.- Parameters:
outputter- the output-manager with which the writers are associated.preop- an operation executed before creation of every directory, if defined.recordedOutputs- all output-names that are passed as arguments to both writers are recorded here.
-
-
Method Details
-
multiplex
Multiplexes between theselectiveandpermissivewriters based on a flag.- Parameters:
selectSelective- if true,selectiveis returned, otherwisepermissive.- Returns:
- the chosen writer
-
secondLevel
A writer that performs a second-level check on which outputs occur, but writes to the top-level directory.- Parameters:
outputNameFirstLevel- the first (top-most) level of an output name, with which writing any second-level outputs is associated.- Returns:
- a newly created writer checking on particular second-level output names.
-
permissive
A writer that allows all output-names, and records the written output-names.- Returns:
- the writer.
-
selective
A writer that allows only certain selected output-names, and records the written output-names.- Returns:
- the writer.
-
recordedOutputs
If defined, all output-names that are passed as arguments to both writers are recorded here.
-