/** * Creates a new configuration object. * * @param featureModel the corresponding feature model. * @param options one or more of:</br> {@link #PARAM_IGNOREABSTRACT},</br> * {@link #PARAM_LAZY},</br> {@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); } }
/** * 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); }