Package crms.lib
Class Database<T>
java.lang.Object
crms.lib.Database<T>
- Type Parameters:
T
- The type of objects that this database will store.
- Direct Known Subclasses:
CarDatabase
,RentalDatabase
The
Database
class is an abstract class that defines a generic
database structure and operations for managing a collection of objects of
type T
.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Fetches the data from the disk.abstract T
getItemById
(String id) Retrieves an object by its ID.abstract void
Saves the data to the disk.
-
Field Details
-
filename
The filename where the data is stored. -
dataList
-
-
Constructor Details
-
Database
public Database()
-
-
Method Details
-
saveToDisk
public abstract void saveToDisk()Saves the data to the disk. -
fetchFromDisk
public abstract void fetchFromDisk()Fetches the data from the disk. -
getItemById
-