Class ObjectOutputStreamGenerator<T extends Serializable>
Object
SingleFileTypeGenerator<T,T>
OneStageGenerator<T>
SerializedGenerator<T>
ObjectOutputStreamGenerator<T>
- Type Parameters:
T
- iteration-type (which must be serializable)
- All Implemented Interfaces:
Generator<T>
,TransformingGenerator<T,
,T> ElementWriter<T>
Generator that writes an element to the file-system using the Java
ObjectOutputStream
format.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
extensionSuffix
(OutputWriteSettings settings) Appended to the standard "serialized" extension, to form the complete extension.void
writeToFile
(T element, OutputWriteSettings settings, Path filePath) Write generated content for {code element} to the filefilePath
.Methods inherited from class org.anchoranalysis.io.generator.serialized.SerializedGenerator
selectFileExtension
Methods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transform
Methods inherited from class org.anchoranalysis.io.generator.SingleFileTypeGenerator
write, writeWithIndex
-
Constructor Details
-
ObjectOutputStreamGenerator
public ObjectOutputStreamGenerator()
-
-
Method Details
-
writeToFile
public void writeToFile(T element, OutputWriteSettings settings, Path filePath) throws OutputWriteFailedException Description copied from class:SingleFileTypeGenerator
Write generated content for {code element} to the filefilePath
.This function deliberately leaves ambiguity over what occurs if a file already exists at
filePath
.- Specified by:
writeToFile
in classSingleFileTypeGenerator<T extends Serializable,
T extends Serializable> - Parameters:
element
- element to be assigned and then transformed.settings
- settings for outputting.filePath
- the path to the file to write to.- Throws:
OutputWriteFailedException
- if the content cannot be written successfully.
-
extensionSuffix
Description copied from class:SerializedGenerator
Appended to the standard "serialized" extension, to form the complete extension.- Specified by:
extensionSuffix
in classSerializedGenerator<T extends Serializable>
- Parameters:
settings
- the associatedOutputWriteSettings
.- Returns:
- the suffix for the extension including any leading period, when appropriate. This may be the empty string if no suffix exists.
-