All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.datacleaner.descriptors.MetricDescriptor Maven / Gradle / Ivy

/**
 * DataCleaner (community edition)
 * Copyright (C) 2014 Neopost - Customer Information Management
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * 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 Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution; if not, write to:
 * Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor
 * Boston, MA  02110-1301  USA
 */
package org.datacleaner.descriptors;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.Set;

import org.apache.metamodel.util.HasName;
import org.datacleaner.api.AnalyzerResult;
import org.datacleaner.api.InputColumn;

/**
 * Descriptor class for {@link AnalyzerResult} metrics.
 *
 * @since AnalyzerBeans 0.16
 */
public interface MetricDescriptor extends Serializable, HasName, Comparable {

    /**
     * Gets the metric value for a particular {@link AnalyzerResult}.
     *
     * @param result
     * @param metricParameters
     * @return the metric value of the particular {@link AnalyzerResult}.
     */
    Number getValue(AnalyzerResult result, MetricParameters metricParameters);

    /**
     * Gets a collection of suggested metric parameters. How these suggestions
     * are created depends upon the AnalyzerResult's data and capabilities, so
     * therefore the quality or extensiveness of the suggestions is not
     * guaranteed and should be considered a sample more than a direction.
     *
     * @return an interable of suggested metric parameters.
     */
    Collection getMetricParameterSuggestions(AnalyzerResult result);

    /**
     * Gets the optional description of the metric
     *
     * @return a humanly readable description of the metric
     */
    String getDescription();

    /**
     * Gets any additional annotations for the metric.
     *
     * @return additional annotations for the metric.
     */
    Set getAnnotations();

    /**
     * Gets a particular annotation for the metric, if available.
     *
     * @param annotationClass
     * @return a particular annotation for the metric, if available.
     */
     A getAnnotation(Class annotationClass);

    /**
     * Determines whether this metric is parameterized with an
     * {@link InputColumn}.
     *
     * @return true if this metric is parameterized with an {@link InputColumn},
     *         or false if not.
     */
    boolean isParameterizedByInputColumn();

    /**
     * Determines whether this metric is parameterized with an {@link String}.
     *
     * @return true if this metric is parameterized with an {@link String}, or
     *         false if not.
     */
    boolean isParameterizedByString();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy