/*
 * ARX: Powerful Data Anonymization
 * Copyright (C) 2012 - 2014 Florian Kohlmayer, Fabian Prasser
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package org.deidentifier.arx.metric.v2;


/**
 * This class provides an implementation of NDS
 * TODO: Add reference
 * 
 * @author Fabian Prasser
 * @author Florian Kohlmayer
 */
public class MetricMDNMNormalizedDomainSharePotentiallyPrecomputed extends AbstractMetricMultiDimensionalPotentiallyPrecomputed {

    /** SVUID*/
    private static final long serialVersionUID = -409964525491865637L;

    /**
     * Creates a new instance. The precomputed variant will be used if 
     * #distinctValues / #rows <= threshold for all quasi-identifiers.
     * 
     * @param threshold
     */
    protected MetricMDNMNormalizedDomainSharePotentiallyPrecomputed(double threshold) {
        super(new MetricMDNMNormalizedDomainShare(),
              new MetricMDNMNormalizedDomainSharePrecomputed(),
              threshold);
    }

    /**
     * Creates a new instance. The precomputed variant will be used if 
     * #distinctValues / #rows <= threshold for all quasi-identifiers.
     * 
     * @param threshold
     * @param function
     */
    protected MetricMDNMNormalizedDomainSharePotentiallyPrecomputed(double threshold,
                                                                    AggregateFunction function) {
        super(new MetricMDNMNormalizedDomainShare(function),
              new MetricMDNMNormalizedDomainSharePrecomputed(function),
              threshold);
    }
    
    @Override
    public String toString() {
        return "Normalized domain share";
    }
}

@@ -2140,16 +2140,708 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Creates a new instance. The precomputed variant will be used if %0A     * #distinctValues / #rows %3C= threshold for all quasi-identifiers.%0A     * %0A     * @param threshold%0A     * @param gsFactor%0A     * @param function%0A     */%0A    protected MetricMDNMNormalizedDomainSharePotentiallyPrecomputed(double threshold,%0A                                                                    double gsFactor,%0A                                                                    AggregateFunction function) %7B%0A        super(new MetricMDNMNormalizedDomainShare(gsFactor, function),%0A              new MetricMDNMNormalizedDomainSharePrecomputed(gsFactor, function),%0A              threshold);%0A    %7D
 %0A    %0A  

Add gsFactor to potentially precomputed instance of NDS