S
- generator-typeT
- exposed-iterator typeV
- hidden-iterator-typepublic class SingleFileTypeGeneratorBridge<S,T,V> extends SingleFileTypeGenerator<T,S>
SingleFileTypeGenerator<V,S>
as if it was an SingleFileTypeGenerator<T,S>
using an function to connect the two.Constructor and Description |
---|
SingleFileTypeGeneratorBridge(SingleFileTypeGenerator<V,S> delegate,
CheckedFunction<T,V,? extends Throwable> elementBridge) |
Modifier and Type | Method and Description |
---|---|
String |
selectFileExtension(OutputWriteSettings settings,
Optional<Logger> logger)
Selects the file/extension to be used for outputting the file.
|
S |
transform(T element)
Applies any necessary preprocessing to create an element suitable for writing to the
filesystem.
|
void |
writeToFile(T element,
OutputWriteSettings settings,
Path filePath) |
write, writeWithIndex
public SingleFileTypeGeneratorBridge(SingleFileTypeGenerator<V,S> delegate, CheckedFunction<T,V,? extends Throwable> elementBridge)
public String selectFileExtension(OutputWriteSettings settings, Optional<Logger> logger) throws OperationFailedException
SingleFileTypeGenerator
selectFileExtension
in class SingleFileTypeGenerator<T,S>
settings
- settings for outputting.logger
- logger for warning for information messages when outputting.OperationFailedException
public S transform(T element) throws OutputWriteFailedException
TransformingGenerator
element
- element to be assigned and then transformedOutputWriteFailedException
- if anything goes wrongpublic void writeToFile(T element, OutputWriteSettings settings, Path filePath) throws OutputWriteFailedException
writeToFile
in class SingleFileTypeGenerator<T,S>
OutputWriteFailedException
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.