package yi.iu.imgdb.learn.absrgn;

import java.util.*;

/**
 * Factory to generate new abstract regions
 */

public class AbsRgnFtGenFactory {

  public AbsRgnFtGenFactory() {
  }

  /**
   * Generate a new abstract region cluster using the existing abstract regions
   * and the generation method defined.  The new abstract region cluster is an
   * instance of AbsRgnProbMapList and will be added into the parameter of
   * "cluster_rgn_lists" and the "new_generator" will be added into the
   * parameter of cluster_generators.
   * @param cluster_rgn_lists the existing abstract region clusters.  Each
   *        element in the list is an instance of AbsRgnProbMapList (cluster)
   * @param cluster_generators the generators for the existing abstract region
   *        clusters
   * @param new_generator the generator for the new abstract region cluster
   */
  public void generate(LinkedList cluster_rgn_lists,
                       LinkedList cluster_generators,
                       AbsRgnFeatureGenerator new_generator) {
    AbsRgnProbMapList new_cluster = new_generator.generate(cluster_rgn_lists);
    cluster_rgn_lists.add(new_cluster);
    cluster_generators.add(new_generator);
  }

}