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 void
add(String key, Object val)
Add object, deletes the old one if it existsboolean
exists(String key)
returns true if an object exists, else returns falseObject
get(String key)
Get the object, and return it, throws RuntimeException if not foundvoid
getReadLock()
void
getWriteLock()
void
kill(String key)
Delete an object if it existsvoid
releaseReadLock()
void
releaseWriteLock()
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)
-