示例#1
0
  /**
   * This method creates a clone of the given {@link Configuration}
   *
   * @param configuration The configuration to clone
   */
  protected Configuration(Configuration configuration) {
    this.featureModel = configuration.featureModel;
    this.ignoreAbstractFeatures = configuration.ignoreAbstractFeatures;
    this.propagator = configuration.propagator.clone(this);
    propagate = false;
    this.root = initRoot();

    for (SelectableFeature f : configuration.features) {
      setManual(f.getName(), f.getManual());
      setAutomatic(f.getName(), f.getAutomatic());
    }
    this.propagate = configuration.propagate;
  }
示例#2
0
  /**
   * Copy constructor. Copies the status of a given configuration.
   *
   * @param configuration
   * @param featureModel the underlying feature model. The model can be different from the old
   *     configuration.
   * @param propagate
   */
  public Configuration(Configuration configuration, IFeatureModel featureModel) {
    this.featureModel = featureModel;
    this.ignoreAbstractFeatures = configuration.ignoreAbstractFeatures;
    this.propagator = new ConfigurationPropagator(this);
    this.propagate = false;
    this.root = initRoot();

    for (SelectableFeature f : configuration.features) {
      try {
        setManual(f.getName(), (f.getManual()));
      } catch (FeatureNotFoundException e) {
      }
    }

    loadPropagator(configuration.propagate);
  }