Пример #1
0
  /**
   * Creates a new configuration object.
   *
   * @param featureModel the corresponding feature model.
   * @param options one or more of:</br> &nbsp;&nbsp;&nbsp;{@link #PARAM_IGNOREABSTRACT},</br>
   *     &nbsp;&nbsp;&nbsp;{@link #PARAM_LAZY},</br> &nbsp;&nbsp;&nbsp;{@link #PARAM_PROPAGATE}
   */
  public Configuration(IFeatureModel featureModel, int options) {
    this.featureModel = featureModel;
    this.ignoreAbstractFeatures = (options & PARAM_IGNOREABSTRACT) != 0;
    this.propagator = new ConfigurationPropagator(this);
    this.root = initRoot();

    if ((options & PARAM_LAZY) != 0) {
      this.propagate = (options & PARAM_PROPAGATE) != 0;
    } else {
      loadPropagator((options & PARAM_PROPAGATE) != 0);
    }
  }
Пример #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);
  }