public class NamedDB extends Object
Constructor | Description |
---|---|
NamedDB() |
Modifier and Type | Method | Description |
---|---|---|
void |
add(String key,
Object val) |
Add object, deletes the old one if it exists
|
boolean |
exists(String key) |
returns true if an object exists, else returns false
|
Object |
get(String key) |
Get the object, and return it, throws RuntimeException if not found
|
void |
getReadLock() |
|
void |
getWriteLock() |
|
void |
kill(String key) |
Delete an object if it exists
|
void |
releaseReadLock() |
|
void |
releaseWriteLock() |
|
Collection<Object> |
values() |
public void getReadLock()
public void releaseReadLock()
public void getWriteLock()
public void releaseWriteLock()
public void kill(String key)
key
- public void add(String key, Object val)
key
- val
- public Object get(String key) throws RuntimeException
key
- non-nullRuntimeException
- if not foundpublic boolean exists(String key)
key
- public Collection<Object> values()