001/**
002 * LocalSimilarityFunction.java
003 * jCOLIBRI2 framework. 
004 * @author Juan A. Recio-Garc�a.
005 * GAIA - Group for Artificial Intelligence Applications
006 * http://gaia.fdi.ucm.es
007 * 03/01/2007
008 */
009package es.ucm.fdi.gaia.jcolibri.method.retrieve.NNretrieval.similarity;
010
011import es.ucm.fdi.gaia.jcolibri.exception.NoApplicableSimilarityFunctionException;
012
013/**
014 * Defines the methods of a local similarity function.
015 * A local similarity function is applied to simple attributes by the NN algorithm.
016 * @author Juan A. Recio-Garcia
017 * @version 1.0
018 */
019public interface LocalSimilarityFunction {
020
021        /**
022         * Computes the similarity between two objects
023         * @param caseObject object of the case
024         * @param queryObject object of the query
025         * @return a value between [0..1]
026         */
027        public double compute(Object caseObject, Object queryObject) throws NoApplicableSimilarityFunctionException;
028        
029        /**
030         * Indicates if the function is applicable to two objects
031         */
032        public boolean isApplicable(Object caseObject, Object queryObject);
033}