public class OutputSequenceFactory<T> extends Object
OutputSequence
with a particular generator and context.
This usually occurs in a subdirectory (relative to outputter
, but not necessarily.
Constructor and Description |
---|
OutputSequenceFactory(Generator<T> generator,
OutputterChecked outputter) |
Modifier and Type | Method and Description |
---|---|
OutputSequenceIncrementing<T> |
incrementingByOne(OutputPatternIntegerSuffix pattern)
Writes elements to
directory , with an incrementing integer in the filename. |
OutputSequenceIncrementing<T> |
incrementingByOneCurrentDirectory(String outputName,
String prefix,
int numberDigits)
Writes elements to the current directory, with an incrementing integer in the filename.
|
void |
incrementingByOneStream(OutputPatternIntegerSuffix pattern,
java.util.stream.Stream<T> stream)
Writes file for each element in a stream with an incrementing integer sequence in the
outputted file-name.
|
OutputSequenceIndexed<T,Integer> |
indexedWithInteger(OutputPatternIntegerSuffix pattern) |
OutputSequenceIndexed<T,String> |
withoutOrder(OutputPatternStringSuffix pattern)
Writes elements (indexed by strings) to
directory , without any order in the sequence. |
OutputSequenceIndexed<T,String> |
withoutOrderCurrentDirectory(String outputName)
Writes elements (indexed by strings) to the current directory, without any order in the
sequence.
|
public OutputSequenceFactory(Generator<T> generator, OutputterChecked outputter)
public OutputSequenceIncrementing<T> incrementingByOne(OutputPatternIntegerSuffix pattern) throws OutputWriteFailedException
directory
, with an incrementing integer in the filename.
The integer in the filename starts at 0.
The eventual filename written becomes $prefix$index.$extension
.
pattern
- how the output of the sequence looks on the file-system.OutputWriteFailedException
- if any outputting cannot be successfully completed.public OutputSequenceIncrementing<T> incrementingByOneCurrentDirectory(String outputName, String prefix, int numberDigits) throws OutputWriteFailedException
The integer in the filename starts at 0.
The eventual filename written becomes $prefix$index.$extension
.
outputName
- the associated output-nameprefix
- a prefix to include before each filename that is outputted.numberDigits
- the number of digits (adding trailing zeros) for the integer part of the
output-name.OutputWriteFailedException
- if any outputting cannot be successfully completed.public OutputSequenceIndexed<T,Integer> indexedWithInteger(OutputPatternIntegerSuffix pattern) throws OutputWriteFailedException
OutputWriteFailedException
public OutputSequenceIndexed<T,String> withoutOrder(OutputPatternStringSuffix pattern) throws OutputWriteFailedException
directory
, without any order in the sequence.
Each index must be unique.
The eventual filename written becomes $prefix$index.$extension
.
pattern
- how the output of the sequence looks on the file-system.OutputWriteFailedException
- if any outputting cannot be successfully completed.public OutputSequenceIndexed<T,String> withoutOrderCurrentDirectory(String outputName) throws OutputWriteFailedException
Each index must be unique.
The eventual filename written becomes $index.$extension
without any prefix or
suffix.
outputName
- the output-name used in rules to determine if the output is enabled or not.OutputWriteFailedException
- if any outputting cannot be successfully completed.public void incrementingByOneStream(OutputPatternIntegerSuffix pattern, java.util.stream.Stream<T> stream) throws OutputWriteFailedException
The integer in the filename starts at 0.
pattern
- how the output of the sequence looks on the file-system.stream
- the items to generate separate filesOutputWriteFailedException
- if any output fails to be written.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.