Class CombinedListGenerator<T>
Object
CombinedListGenerator<T>
- Type Parameters:
T- element-type
- All Implemented Interfaces:
Generator<T>,MultipleFileTypeGenerator<T>,ElementWriter<T>
- Direct Known Subclasses:
ObjectWithBoundingBoxGenerator
Several generators combined together with a common element-type.
One generator must always exist. Zero generators is never allowed.
Each generator is associated with a unique output-name.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionCombinedListGenerator(Stream<NameValue<Generator<T>>> namedGenerators) Create from a stream of named generators.CombinedListGenerator(NameValue<Generator<T>> namedGenerator) Create from a single named generator.CombinedListGenerator(Generator<T>... generator) Create from multiple named generators. -
Method Summary
Modifier and TypeMethodDescriptionvoidwrite(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(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
-
CombinedListGenerator
Create from a single named generator.- Parameters:
namedGenerator- the generator with an associated name.
-
CombinedListGenerator
Create from multiple named generators.- Parameters:
generator- the generators, each with an associated name.
-
CombinedListGenerator
Create from a stream of named generators.- Parameters:
namedGenerators- the stream of generators, each with an associated name.
-
CombinedListGenerator
public CombinedListGenerator()
-
-
Method Details
-
write
public void write(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(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.
-