All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class aid.cbr.tools.core.memory.casebase.SimpleCaseBase

java.lang.Object
   |
   +----aid.cbr.tools.core.memory.casebase.AbstractCaseBase
           |
           +----aid.cbr.tools.core.memory.casebase.SimpleCaseBase

public abstract class SimpleCaseBase
extends AbstractCaseBase
implements CaseBase
Implements basic operation for local and simple case bases. This classe facilitate the implementation of local and simple case bases. It must be used specialization.

Version:
$Revision$, $Date$
Author:
M. Jaczynski

Variable Index

 o _cases
 o _idGenerator
 o _metadata

Constructor Index

 o SimpleCaseBase(String, IdentifierGenerator, Map)
Creates a new simple case base.

Method Index

 o addCase(CbrCase)
 o addSubCaseBase(CaseBase)
Adds a sub case base - operation not supported by simple case base.
 o addSubCaseBase(int, CaseBase)
Adds a sub case base at a given position - operation not supported by simple case base.
 o cases()
 o clear()
 o commitCase(CbrCase)
 o deleteCase(Object)
 o getCase(Object)
 o getIdentifierGenerator()
 o getMetadata()
 o isCloning()
Returns the value of the cloning flag.
 o removeAllSubCaseBases()
remove all sub-case bases.
 o removeSubCaseBase(CaseBase)
Removes a case base from the list of sub-case bases.
 o removeSubCaseBase(int)
Removes a case base at a given position the the list of sub-case bases.
 o setCloning(boolean)
Indiquates to the case base that all the data (cases and metadata) must be cloned.
 o setMetadata(CaseBaseMetadata)
 o subCaseBases()
Returns the list of sub-case bases - this list is always empty.

Variables

 o _cases
 protected Map _cases
 o _idGenerator
 protected IdentifierGenerator _idGenerator
 o _metadata
 protected CaseBaseMetadata _metadata

Constructors

 o SimpleCaseBase
 public SimpleCaseBase(String name,
                       IdentifierGenerator idGen,
                       Map map)
Creates a new simple case base.

Parameters:
name - the name of the case base
idGen - the identifier genertor used to generate new case identifier
map - the Map object used to store the case base.

Methods

 o addSubCaseBase
 public void addSubCaseBase(CaseBase cb) throws CaseBaseAccessException
Adds a sub case base - operation not supported by simple case base. Throws CaseBaseAccessException

Parameters:
cb - the case base to be added
Throws: CaseBaseAccessException
the case base cannot be added
Overrides:
addSubCaseBase in class AbstractCaseBase
 o addSubCaseBase
 public void addSubCaseBase(int position,
                            CaseBase cb) throws CaseBaseAccessException
Adds a sub case base at a given position - operation not supported by simple case base. Throws CaseBaseAccessException

Parameters:
position - the position where the case base must added or inserted
cb - the case base to be added
Throws: CaseBaseAccessException
the case base cannot be added
Overrides:
addSubCaseBase in class AbstractCaseBase
 o removeSubCaseBase
 public void removeSubCaseBase(CaseBase cb) throws CaseBaseAccessException
Removes a case base from the list of sub-case bases. Does nothing.

Parameters:
cb - the case base to be removed.
Throws: CaseBaseAccessException
the case base cannot be removed
Overrides:
removeSubCaseBase in class AbstractCaseBase
 o removeSubCaseBase
 public void removeSubCaseBase(int position) throws CaseBaseAccessException
Removes a case base at a given position the the list of sub-case bases. Does nothing.

Parameters:
position - the position in the list of sub-case bases
Throws: CaseBaseAccessException
the case base cannot be removed
Overrides:
removeSubCaseBase in class AbstractCaseBase
 o removeAllSubCaseBases
 public void removeAllSubCaseBases() throws CaseBaseAccessException
remove all sub-case bases. Does nothing.

Throws: CaseBaseAccessException
the case bases cannot be removed
Overrides:
removeAllSubCaseBases in class AbstractCaseBase
 o subCaseBases
 public List subCaseBases() throws CaseBaseAccessException
Returns the list of sub-case bases - this list is always empty.

Returns:
the sub-case bases
Throws: CaseBaseAccessException
the list of sub-case bases cannot be returned
Overrides:
subCaseBases in class AbstractCaseBase
 o addCase
 public Object addCase(CbrCase newCase) throws CaseBaseAccessException
Overrides:
addCase in class AbstractCaseBase
 o getCase
 public CbrCase getCase(Object caseId) throws CaseBaseAccessException
Overrides:
getCase in class AbstractCaseBase
 o cases
 public Map cases() throws CaseBaseAccessException
Overrides:
cases in class AbstractCaseBase
 o commitCase
 public void commitCase(CbrCase aCase) throws CaseBaseAccessException
Overrides:
commitCase in class AbstractCaseBase
 o deleteCase
 public void deleteCase(Object id) throws CaseBaseAccessException
Overrides:
deleteCase in class AbstractCaseBase
 o clear
 public void clear() throws CaseBaseAccessException
Overrides:
clear in class AbstractCaseBase
 o getMetadata
 public CaseBaseMetadata getMetadata() throws CaseBaseAccessException
Overrides:
getMetadata in class AbstractCaseBase
 o setMetadata
 public void setMetadata(CaseBaseMetadata md) throws CaseBaseAccessException
Overrides:
setMetadata in class AbstractCaseBase
 o setCloning
 public void setCloning(boolean b)
Indiquates to the case base that all the data (cases and metadata) must be cloned. This is useful to ensure that the case base cannot be altered by modifing directly the objects. In that case, the case objects must implement the Clone interface. param b the boolean flag

 o isCloning
 public boolean isCloning()
Returns the value of the cloning flag.

 o getIdentifierGenerator
 public IdentifierGenerator getIdentifierGenerator()

All Packages  Class Hierarchy  This Package  Previous  Next  Index