001    /**
002     * StoreCasesMethod.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     * 05/01/2007
008     */
009    package jcolibri.method.retain;
010    
011    import java.util.ArrayList;
012    import java.util.Collection;
013    
014    import jcolibri.cbrcore.CBRCase;
015    import jcolibri.cbrcore.CBRCaseBase;
016    
017    /**
018     * Stores cases in the case base.
019     * @author Juan A. Recio-Garcia
020     *
021     */
022    public class StoreCasesMethod {
023    
024            
025            /**
026             * Simple method that adds some cases to the case base invoking caseBase->learnCases().
027             */
028            public static void storeCases(CBRCaseBase caseBase, Collection<CBRCase> cases)
029            {
030                    caseBase.learnCases(cases);
031            }
032            
033            /**
034             * Simple method that add a case to the case base invoking caseBase->learnCases().
035             */
036            public static void storeCase(CBRCaseBase caseBase, CBRCase _case)
037            {
038                    Collection<CBRCase> cases = new ArrayList<CBRCase>();
039                    cases.add(_case);
040                    caseBase.learnCases(cases);
041            }
042    
043    }