Package net.i2p.BOB
Class NamedDB
- java.lang.Object
-
- net.i2p.BOB.NamedDB
-
public class NamedDB extends Object
Internal database to relate nicknames to options to values- Author:
- sponge
-
-
Constructor Summary
Constructors Constructor Description NamedDB()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String key, Object val)Add object, deletes the old one if it existsbooleanexists(String key)returns true if an object exists, else returns falseObjectget(String key)Get the object, and return it, throws RuntimeException if not foundvoidgetReadLock()voidgetWriteLock()voidkill(String key)Delete an object if it existsvoidreleaseReadLock()voidreleaseWriteLock()Collection<Object>values()
-
-
-
Method Detail
-
getReadLock
public void getReadLock()
-
releaseReadLock
public void releaseReadLock()
-
getWriteLock
public void getWriteLock()
-
releaseWriteLock
public void releaseWriteLock()
-
kill
public void kill(String key)
Delete an object if it exists- Parameters:
key-
-
add
public void add(String key, Object val)
Add object, deletes the old one if it exists- Parameters:
key-val-
-
get
public Object get(String key) throws RuntimeException
Get the object, and return it, throws RuntimeException if not found- Parameters:
key- non-null- Returns:
- Object non-null
- Throws:
RuntimeException- if not found
-
exists
public boolean exists(String key)
returns true if an object exists, else returns false- Parameters:
key-- Returns:
- true if an object exists, else returns false
-
values
public Collection<Object> values()
- Since:
- 0.9.29 replaces getcount() and getnext(int)
-
-