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 */ 009 package jcolibri.method.retrieve.NNretrieval.similarity; 010 011 012 /** 013 * Defines the methods of a local similarity function. 014 * A local similarity function is applied to simple attributes by the NN algorithm. 015 * @author Juan A. Recio-Garcia 016 * @version 1.0 017 */ 018 public interface LocalSimilarityFunction { 019 020 /** 021 * Computes the similarity between two objects 022 * @param caseObject object of the case 023 * @param queryObject object of the query 024 * @return a value between [0..1] 025 */ 026 public double compute(Object caseObject, Object queryObject) throws jcolibri.exception.NoApplicableSimilarityFunctionException; 027 028 /** 029 * Indicates if the function is applicable to two objects 030 */ 031 public boolean isApplicable(Object caseObject, Object queryObject); 032 }