Class CaseLibrary

java.lang.Object
   |
   +----CaseLibrary

public class CaseLibrary
extends Object
implements Serializable
The class `CaseLibrary' represents a case library. It encapsulates an organisation of cases within the library, allowing new cases to be added and existing cases to be retrieved.


Constructor Index

 o CaseLibrary()
Constructs an instance of a case library which is initially empty.
 o CaseLibrary(String)
Constructs an instance of a case library, loading it from a binary file.

Method Index

 o insert(Case)
Adds a new case in the case library.
 o retrieve(Frame)
Retrieves cases from the case library.
 o save(String)
Saves the case library to a binary file.

Constructors

 o CaseLibrary
 public CaseLibrary()
Constructs an instance of a case library which is initially empty.

 o CaseLibrary
 public CaseLibrary(String filename) throws FileNotFoundException
Constructs an instance of a case library, loading it from a binary file.

Parameters:
filename - The filename of the case library binary.
Throws: FileNotFoundException
If the file does not exist.

Methods

 o retrieve
 public Vector retrieve(Frame prompt)
Retrieves cases from the case library.

Parameters:
prompt - A frame to use as a retrieval prompt.
Returns:
s The set of cases which the prompt reminds the CBR system of.
 o insert
 public void insert(Case newCase)
Adds a new case in the case library. Indexes it by the frame class of the frame in its "problem" slot.

Parameters:
case - The new case to store in the case library.
 o save
 public void save(String filename)
Saves the case library to a binary file.

Parameters:
filename - The filename of the case library binary.