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
-
_cases
-
-
_idGenerator
-
-
_metadata
-
-
SimpleCaseBase(String, IdentifierGenerator, Map)
- Creates a new simple case base.
-
addCase(CbrCase)
-
-
addSubCaseBase(CaseBase)
- Adds a sub case base - operation not supported by simple case base.
-
addSubCaseBase(int, CaseBase)
- Adds a sub case base at a given position - operation not supported by simple case base.
-
cases()
-
-
clear()
-
-
commitCase(CbrCase)
-
-
deleteCase(Object)
-
-
getCase(Object)
-
-
getIdentifierGenerator()
-
-
getMetadata()
-
-
isCloning()
- Returns the value of the cloning flag.
-
removeAllSubCaseBases()
- remove all sub-case bases.
-
removeSubCaseBase(CaseBase)
- Removes a case base from the list of sub-case bases.
-
removeSubCaseBase(int)
- Removes a case base at a given position the the list of sub-case bases.
-
setCloning(boolean)
- Indiquates to the case base that all the data (cases and metadata) must be cloned.
-
setMetadata(CaseBaseMetadata)
-
-
subCaseBases()
- Returns the list of sub-case bases - this list is always empty.
_cases
protected Map _cases
_idGenerator
protected IdentifierGenerator _idGenerator
_metadata
protected CaseBaseMetadata _metadata
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.
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
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
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
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
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
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
addCase
public Object addCase(CbrCase newCase) throws CaseBaseAccessException
- Overrides:
- addCase in class AbstractCaseBase
getCase
public CbrCase getCase(Object caseId) throws CaseBaseAccessException
- Overrides:
- getCase in class AbstractCaseBase
cases
public Map cases() throws CaseBaseAccessException
- Overrides:
- cases in class AbstractCaseBase
commitCase
public void commitCase(CbrCase aCase) throws CaseBaseAccessException
- Overrides:
- commitCase in class AbstractCaseBase
deleteCase
public void deleteCase(Object id) throws CaseBaseAccessException
- Overrides:
- deleteCase in class AbstractCaseBase
clear
public void clear() throws CaseBaseAccessException
- Overrides:
- clear in class AbstractCaseBase
getMetadata
public CaseBaseMetadata getMetadata() throws CaseBaseAccessException
- Overrides:
- getMetadata in class AbstractCaseBase
setMetadata
public void setMetadata(CaseBaseMetadata md) throws CaseBaseAccessException
- Overrides:
- setMetadata in class AbstractCaseBase
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
isCloning
public boolean isCloning()
- Returns the value of the cloning flag.
getIdentifierGenerator
public IdentifierGenerator getIdentifierGenerator()
All Packages Class Hierarchy This Package Previous Next Index