Class Generator<C>

  • Type Parameters:
    C - The type of components to assemble
    Direct Known Subclasses:
    FileGenerator

    public class Generator<C>
    extends java.lang.Object
    Generate a product by assembling components.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Metrics generate​(C component, DataBuffer product)
      Generate a product from a single piece.
      Metrics generate​(java.lang.Iterable<C> components, DataBuffer product)
      Generate a product by assembling components.
      Metrics generate​(java.util.Enumeration<C> components, DataBuffer product)
      Generate a product by assembling components.
      Metrics generate​(java.util.Iterator<C> components, DataBuffer product)
      Generate a product by assembling components.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Generator

        public Generator​(Assembler<C> assembler)
        Assemble a product using the given Assembler.
        Parameters:
        assembler - The assembler to build up the product
    • Method Detail

      • generate

        public Metrics generate​(java.lang.Iterable<C> components,
                                DataBuffer product)
                         throws java.io.IOException
        Generate a product by assembling components.
        Parameters:
        components - The components to assemble
        product - The output to write the assembled product to
        Returns:
        Metrics about the generation process
        Throws:
        java.io.IOException - When an I/O error occurs
      • generate

        public Metrics generate​(java.util.Iterator<C> components,
                                DataBuffer product)
                         throws java.io.IOException
        Generate a product by assembling components.
        Parameters:
        components - The components to assemble
        product - Storage for the assembled product
        Returns:
        Metrics about the generation process
        Throws:
        java.io.IOException - When an I/O error occurs
      • generate

        public Metrics generate​(java.util.Enumeration<C> components,
                                DataBuffer product)
                         throws java.io.IOException
        Generate a product by assembling components.
        Parameters:
        components - The components to assemble
        product - The output to write the assembled product to
        Returns:
        Metrics about the generation process
        Throws:
        java.io.IOException - When an I/O error occurs
      • generate

        public Metrics generate​(C component,
                                DataBuffer product)
                         throws java.io.IOException
        Generate a product from a single piece.
        Parameters:
        component - The component to generate the product from
        product - The output to write the assembled product to
        Returns:
        Metrics about the generation process
        Throws:
        java.io.IOException - When an I/O error occurs