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 newCollectionGeneratorinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(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).voidwriteWithIndex(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 newCollectionGeneratorinstance.- 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:ElementWriterWrites a non-indexable output (an output that isn't part of a collection of other similar items).- Specified by:
writein 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:ElementWriterWrites an indexable output (many outputs of the same type, uniquely identified by an index).- Specified by:
writeWithIndexin 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.
-