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 StringextensionSuffix(OutputWriteSettings settings) Appended to the standard "serialized" extension, to form the complete extension.voidwriteToFile(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
selectFileExtensionMethods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transformMethods 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:SingleFileTypeGeneratorWrite 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:
writeToFilein 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:SerializedGeneratorAppended to the standard "serialized" extension, to form the complete extension.- Specified by:
extensionSuffixin 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.
-