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

org.eobjects.analyzer.descriptors.MetricDescriptor Maven / Gradle / Ivy

The newest version!
/**
 * AnalyzerBeans
 * 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.eobjects.analyzer.descriptors;

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

import org.eobjects.analyzer.data.InputColumn;
import org.eobjects.analyzer.result.AnalyzerResult;
import org.apache.metamodel.util.HasName;

/**
 * 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}.
     */
    public 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.
     */
    public Collection getMetricParameterSuggestions(AnalyzerResult result);

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

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

    /**
     * Gets a particular annotation for the metric, if available.
     * 
     * @param annotationClass
     * @return a particular annotation for the metric, if available.
     */
    public  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.
     */
    public 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.
     */
    public boolean isParameterizedByString();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy