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.
-
CaseLibrary()
- Constructs an instance of a case library which is initially empty.
-
CaseLibrary(String)
- Constructs an instance of a case library, loading it from a binary
file.
-
insert(Case)
- Adds a new case in the case library.
-
retrieve(Frame)
- Retrieves cases from the case library.
-
save(String)
- Saves the case library to a binary file.
CaseLibrary
public CaseLibrary()
- Constructs an instance of a case library which is initially empty.
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.
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.
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.
save
public void save(String filename)
- Saves the case library to a binary file.
- Parameters:
- filename - The filename of the case library binary.