Class CollectionGenerator<T>
Object
CollectionGenerator<T>
- Type Parameters:
T
- element-type in collection
- All Implemented Interfaces:
Generator<Collection<T>>
,ElementWriter<Collection<T>>
Writes a collection of elements as a subdirectory with each element as a single file in the
subdirectory.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionGenerator
(Generator<T> generator, String prefix) Creates a newCollectionGenerator
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
write
(Collection<T> element, OutputNameStyle outputNameStyle, ElementOutputter outputter) Writes a non-indexable output (an output that isn't part of a collection of other similar items).void
writeWithIndex
(Collection<T> element, String index, IndexableOutputNameStyle outputNameStyle, ElementOutputter outputter) Writes an indexable output (many outputs of the same type, uniquely identified by an index).
-
Constructor Details
-
CollectionGenerator
Creates a newCollectionGenerator
instance.- Parameters:
generator
- Generator to use for writing each element.prefix
- Prefix in outputted name for each element.
-
-
Method Details
-
write
public void write(Collection<T> element, OutputNameStyle outputNameStyle, ElementOutputter outputter) throws OutputWriteFailedException Description copied from interface:ElementWriter
Writes a non-indexable output (an output that isn't part of a collection of other similar items).- Specified by:
write
in interfaceElementWriter<T>
- Parameters:
element
- the element to write.outputNameStyle
- how to write output-names.outputter
- how the element is outputted.- Throws:
OutputWriteFailedException
- if the write operation fails.
-
writeWithIndex
public void writeWithIndex(Collection<T> element, String index, IndexableOutputNameStyle outputNameStyle, ElementOutputter outputter) throws OutputWriteFailedException Description copied from interface:ElementWriter
Writes an indexable output (many outputs of the same type, uniquely identified by an index).- Specified by:
writeWithIndex
in interfaceElementWriter<T>
- Parameters:
element
- the element to write.index
- a string that uniquely identifies this element compared to others in the same write operation.outputNameStyle
- how to write output-names.outputter
- how the element is outputted.- Throws:
OutputWriteFailedException
- if the write operation fails.
-