|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ItemTable<K1,K2,V>
ItemTable is table like structure to have key-value pairs. It has two keys : Super Key (K1) and Sub Key (K2). The implementor can use this according to their need. Basically is will be implemented with Hash structure. It provides operations to put and get the objects based on their keys.
Method Summary | |
---|---|
void |
close()
Close the file associate with the table |
void |
commit()
Commits the table contents to the file |
java.util.Map<K2,V> |
get(K1 k1)
Gets the object based on sub key |
V |
get(K1 k1,
K2 k2)
Gets the object based on super and sub key |
V |
get(K2 k2)
Gets the object based on sub key |
java.util.List<V> |
getAllItems()
Returns all the items in the table |
java.lang.Object |
getObject(java.lang.Object o)
Gets the object from the table. |
void |
put(K1 k1,
K2 k2,
V v)
Puts the object based on the super and sub key |
void |
put(K1 k1,
V v)
Puts the object based on the super key |
void |
put(V v)
Puts the object into the table |
boolean |
remove(K1 k1,
K2 k2)
Removes the item based on the super and sub key |
boolean |
remove(K2 k2)
Removes the item based on the sub key |
int |
size()
Size of the table (number items in the table) |
Method Detail |
---|
void close() throws java.io.IOException
java.io.IOException
- if file operations failvoid commit() throws java.io.IOException
java.io.IOException
- if file operations failjava.util.Map<K2,V> get(K1 k1)
k1
- super key
V get(K1 k1, K2 k2)
k1
- super keyk2
- sub key
V get(K2 k2)
k2
- sub key
java.util.List<V> getAllItems()
java.lang.Object getObject(java.lang.Object o)
o
- key object
void put(K1 k1, K2 k2, V v)
k1
- super keyk2
- sub keyv
- valuevoid put(K1 k1, V v)
k1
- super keyv
- valuevoid put(V v)
boolean remove(K1 k1, K2 k2)
k1
- super keyk2
- sub key
boolean remove(K2 k2)
k2
- sub key
int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |