jcolibri.casebase
Class CachedLinealCaseBase

java.lang.Object
  extended by jcolibri.casebase.CachedLinealCaseBase
All Implemented Interfaces:
CBRCaseBase

public class CachedLinealCaseBase
extends java.lang.Object
implements CBRCaseBase

Cached case base that only persists cases when closing. learn() and forget() are not synchronized with the persistence until close() is invoked.

This class presents better performance that LinelCaseBase as only access to the persistence once. This case base is used for evaluation.

Author:
Juan A. Recio-García
See Also:
LinealCaseBase

Constructor Summary
CachedLinealCaseBase()
           
 
Method Summary
 void close()
          Closes the case base saving or deleting the cases of the persistence media
 void forgetCases(java.util.Collection<CBRCase> cases)
          Forgets cases.
 java.util.Collection<CBRCase> getCases()
          Returns working cases.
 java.util.Collection<CBRCase> getCases(CaseBaseFilter filter)
          TODO.
 void init(Connector connector)
          Initializes the Case Base with the cases read from the given connector.
 void learnCases(java.util.Collection<CBRCase> cases)
          Learns cases that are only saved when closing the Case Base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedLinealCaseBase

public CachedLinealCaseBase()
Method Detail

close

public void close()
Closes the case base saving or deleting the cases of the persistence media

Specified by:
close in interface CBRCaseBase

forgetCases

public void forgetCases(java.util.Collection<CBRCase> cases)
Forgets cases. It only removes the cases from the storage media when closing.

Specified by:
forgetCases in interface CBRCaseBase
Parameters:
cases - to be removed

getCases

public java.util.Collection<CBRCase> getCases()
Returns working cases.

Specified by:
getCases in interface CBRCaseBase
Returns:
all the cases available on this case base

getCases

public java.util.Collection<CBRCase> getCases(CaseBaseFilter filter)
TODO.

Specified by:
getCases in interface CBRCaseBase
Parameters:
filter - a case base filter
Returns:
a collection of cases

init

public void init(Connector connector)
          throws InitializingException
Initializes the Case Base with the cases read from the given connector.

Specified by:
init in interface CBRCaseBase
Throws:
InitializingException

learnCases

public void learnCases(java.util.Collection<CBRCase> cases)
Learns cases that are only saved when closing the Case Base.

Specified by:
learnCases in interface CBRCaseBase
Parameters:
cases - to be added

GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es