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
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()
-
Constructor Details
-
NamedDB
public NamedDB()
-
-
Method Details
-
getReadLock
public void getReadLock() -
releaseReadLock
public void releaseReadLock() -
getWriteLock
public void getWriteLock() -
releaseWriteLock
public void releaseWriteLock() -
kill
Delete an object if it exists- Parameters:
key-
-
add
Add object, deletes the old one if it exists- Parameters:
key-val-
-
get
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
returns true if an object exists, else returns false- Parameters:
key-- Returns:
- true if an object exists, else returns false
-
values
- Since:
- 0.9.29 replaces getcount() and getnext(int)
-