001    /**
002     * CBRCaseBase.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.cbrcore;
010    
011    import java.util.Collection;
012    
013    /**
014     * This interface defines the methods that at least any Case Base must implement
015     * to be transparently used by the framework.
016     * <p>
017     * A Case Base is the in-memory organization of the cases. 
018     * Cases are read from the persistence media an loaded into an implementation of this interface.
019     * 
020     * Further implementations will provide cache mechanisms, optimized organizations, etc.
021     * 
022     * @author Juan A. Recio-García
023     */
024    public interface CBRCaseBase {
025    
026    
027        /**
028         * Initializes the case base. This methods recibes the connector that manages the persistence media.
029         *
030         */
031        public void init(Connector connector) throws jcolibri.exception.InitializingException;
032        
033        
034        /**
035         * DeInitializes the case base.
036         *
037         */
038        public void close();
039        
040    
041    
042            /**
043             * Returns all the cases available on this case base
044             * 
045             * @return all the cases available on this case base
046             */
047            public Collection<CBRCase> getCases();
048            
049            
050        /**
051         * Returns some cases depending on the filter
052         * @param filter a case base filter
053         * @return a collection of cases
054         */
055        public Collection<CBRCase> getCases(CaseBaseFilter filter);
056    
057    
058            /**
059             * Adds a collection of new CBRCase objects to the current case base
060             * 
061             * @param cases
062             *            to be added
063             */
064            public void learnCases(Collection<CBRCase> cases);
065    
066            /**
067             * Removes a collection of new CBRCase objects to the current case base
068             * 
069             * @param cases
070             *            to be removed
071             */
072            public void forgetCases(Collection<CBRCase> cases);
073    
074    
075    
076    }