|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
K - The type of the key of the elements stored in the database.V - The values stored in the database.public interface DAO<K,V>
The Data Object Interface (DAO) works as a layer between the application logic and the database.
| Field Summary | |
|---|---|
static int |
ADD
Constant for the operation of adding a new element in the database. |
static int |
DELETE
Constant for the operation of deleting a new operation from the database. |
static int |
GET
The constant that denotes the operation of getting an element from the database. |
static java.lang.String |
HOST
The address of the host that we must use, whenever we are testing the client and server applications on the same machine. |
static int |
PORT
The port in which the server will be waiting for connections. |
static int |
SIZE
Constant for the operation of asking for the size of the database. |
static int |
UPDATE
Constant for the operation of putting a new element in the database. |
| Method Summary | |
|---|---|
void |
add(K key,
V value)
Adds a new object into the database. |
void |
delete(K key)
Removes an object from the database. |
V |
get(K key)
Returns a value, given a key. |
int |
size()
Informs the number of elements stored in the database. |
void |
update(K key,
V value)
Updates an object in the database. |
| Field Detail |
|---|
static final int GET
static final int ADD
static final int DELETE
static final int UPDATE
static final int SIZE
static final int PORT
static final java.lang.String HOST
| Method Detail |
|---|
V get(K key)
key - the id of the object that must be found.
void add(K key,
V value)
key - the id of the object that will be inserted into the database.value - the value associated with the key K.void delete(K key)
key - the id of the object that will be removed.
void update(K key,
V value)
key - the id of the object that will be replaced.value - the new value of the object associated with the given key.int size()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||