cbr.framework
Class CaseBase

java.lang.Object
  extended by cbr.framework.CaseBase

public class CaseBase
extends Object

CAMUS: Case Assembly, Maintenance & Usage System

Bugs, improvements, concerns can be reported to jrub001@aucklanduni.ac.nz

The CaseBase class holds a collection of Cases in a list structure. It provides methods to acquire, maintain and retrieve cases in the case base.

Version:
1.0
Author:
Jonathan Rubin

Field Summary
static int NUMBER_DETAILS
          The number of attributes each feature must specify in flat file format.
 
Constructor Summary
CaseBase()
          Creates an empty case base
CaseBase(String fileName)
          Creates a case base described in flat file format.
 
Method Summary
 void assembleCaseBase(String fileName)
          Given a case base represented as a flat file, this method will load the cases into working memory.
 List<Case> getAllCases()
          Provides a reference to the case-base.
 void printAllCases()
          Prints all the cases in the current case-base to standard output.
 void retain(Case targetCase, String fileName)
          Retain the target case by adding its features and solution to the flat file used to represent the case-base.
 void retainWithReplacement(Case existingCase, String fileName)
          Retains an existing case in the case base to reflect changes made to the outcome of the case.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMBER_DETAILS

public static final int NUMBER_DETAILS
The number of attributes each feature must specify in flat file format.

See Also:
Constant Field Values
Constructor Detail

CaseBase

public CaseBase()
Creates an empty case base


CaseBase

public CaseBase(String fileName)
Creates a case base described in flat file format.

Parameters:
fileName - the name of the file that holds the cases
Method Detail

assembleCaseBase

public void assembleCaseBase(String fileName)
Given a case base represented as a flat file, this method will load the cases into working memory.

Parameters:
fileName - the name of the file that holds the cases

retain

public void retain(Case targetCase,
                   String fileName)
Retain the target case by adding its features and solution to the flat file used to represent the case-base.

Parameters:
targetCase - the case to be retained
fileName - the file to retain the persisted case

retainWithReplacement

public void retainWithReplacement(Case existingCase,
                                  String fileName)
Retains an existing case in the case base to reflect changes made to the outcome of the case.

Parameters:
existingCase - the case whose outcome has been modified
fileName - the file to retain the persisted case

getAllCases

public List<Case> getAllCases()
Provides a reference to the case-base.

Returns:
the case base

printAllCases

public void printAllCases()
Prints all the cases in the current case-base to standard output.