001    /**
002     * MoreLikeThis.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     * 02/11/2007
008     */
009    package jcolibri.extensions.recommendation.navigationByProposing.queryElicitation;
010    
011    import java.util.Collection;
012    
013    import jcolibri.cbrcore.CBRCase;
014    import jcolibri.cbrcore.CBRQuery;
015    import jcolibri.cbrcore.CaseComponent;
016    import jcolibri.util.CopyUtils;
017    
018    /**
019     * Replaces current query with the description of the selected case.
020     * <p>See:
021     * <p>L. McGinty and B. Smyth. Comparison-based recommendation. In ECCBR'02: 
022     * Proceedings of the 6th European Conference on Advances in Case-Based
023     * Reasoning, pages 575-589, London, UK, 2002. Springer-Verlag.
024     * 
025     * @author Juan A. Recio-Garcia
026     * @author Developed at University College Cork (Ireland) in collaboration with Derek Bridge.
027     * @version 1.0
028     *
029     */
030    public class MoreLikeThis implements ComparisonQueryElicitation
031    {
032        
033        /******************************************************************************/
034        /**                           STATIC METHODS                                 **/
035        /******************************************************************************/
036        
037        /**
038         * Replaces current query with the description of the selected case.
039         */
040        public static void moreLikeThis(CBRQuery query, CBRCase selectedCase)
041        {
042            CaseComponent cc = CopyUtils.copyCaseComponent(selectedCase.getDescription());
043            query.setDescription(cc);       
044        }
045        
046        /******************************************************************************/
047        /**                           OBJECT METHODS                                 **/
048        /******************************************************************************/
049    
050        
051        /**
052         * Replaces current query with the description of the selected case.
053         */
054        public void reviseQuery(CBRQuery query, CBRCase selectedCase, Collection<CBRCase> proposedCases)
055        {
056            moreLikeThis(query, selectedCase);
057        }
058    }