Class HDF5ObjectsGenerator
- All Implemented Interfaces:
Generator<ObjectCollection>
,TransformingGenerator<ObjectCollection,
,ObjectCollection> ElementWriter<ObjectCollection>
A generator that writes a
ObjectCollection
to a HDF5 file.- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of the attribute in the root of the HDF5 that stores the number of objects. -
Constructor Summary
ConstructorsConstructorDescriptionCreates with compression activated.HDF5ObjectsGenerator
(boolean compressed) Creates a newHDF5ObjectsGenerator
instance. -
Method Summary
Modifier and TypeMethodDescriptionselectFileExtension
(OutputWriteSettings settings, Optional<Logger> logger) Selects the file/extension to be used for outputting the file.void
writeToFile
(ObjectCollection element, OutputWriteSettings settings, Path filePath) Write generated content for {code element} to the filefilePath
.Methods inherited from class org.anchoranalysis.io.generator.OneStageGenerator
transform
Methods inherited from class org.anchoranalysis.io.generator.SingleFileTypeGenerator
write, writeWithIndex
-
Field Details
-
NUMBER_OBJECTS_ATTRIBUTE_NAME
Name of the attribute in the root of the HDF5 that stores the number of objects.- See Also:
-
-
Constructor Details
-
HDF5ObjectsGenerator
public HDF5ObjectsGenerator()Creates with compression activated. -
HDF5ObjectsGenerator
public HDF5ObjectsGenerator(boolean compressed) Creates a newHDF5ObjectsGenerator
instance.- Parameters:
compressed
- Whether to use compression when writing the object-masks in HDF5.
-
-
Method Details
-
writeToFile
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<ObjectCollection,
ObjectCollection> - Parameters:
element
- element to be assigned and then transformed.settings
- settings for outputting.filePath
- the path to the file to write to.
-
selectFileExtension
Description copied from class:SingleFileTypeGenerator
Selects the file/extension to be used for outputting the file.- Specified by:
selectFileExtension
in classSingleFileTypeGenerator<ObjectCollection,
ObjectCollection> - Parameters:
settings
- settings for outputting.logger
- logger for warning for information messages when outputting.- Returns:
- the file extension (without leading period) to be used for outputting.
-