net.i2p.BOB
Class NamedDB

java.lang.Object
  extended by net.i2p.BOB.NamedDB

public class NamedDB
extends java.lang.Object

Internal database to relate nicknames to options to values

Author:
sponge

Constructor Summary
NamedDB()
          make initial NULL object
 
Method Summary
 void add(java.lang.Object key, java.lang.Object val)
          Add object to the array, deletes the old one if it exists
 boolean exists(java.lang.Object key)
          returns true if an object exists, else returns false
 java.lang.Object get(java.lang.Object key)
          Get the object, and return it, throws RuntimeException
 int getcount()
           
 java.lang.Object getnext(int i)
           
 void getReadLock()
           
 void getWriteLock()
           
 int idx(java.lang.Object key)
          Find objects in the array, returns it's index or throws exception
 void kill(java.lang.Object key)
          Delete an object from array if it exists
 void releaseReadLock()
           
 void releaseWriteLock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedDB

public NamedDB()
make initial NULL object

Method Detail

getReadLock

public void getReadLock()

releaseReadLock

public void releaseReadLock()

getWriteLock

public void getWriteLock()

releaseWriteLock

public void releaseWriteLock()

idx

public int idx(java.lang.Object key)
        throws java.lang.ArrayIndexOutOfBoundsException
Find objects in the array, returns it's index or throws exception

Parameters:
key -
Returns:
an objects index
Throws:
java.lang.ArrayIndexOutOfBoundsException - when key does not exist

kill

public void kill(java.lang.Object key)
Delete an object from array if it exists

Parameters:
key -

add

public void add(java.lang.Object key,
                java.lang.Object val)
Add object to the array, deletes the old one if it exists

Parameters:
key -
val -

get

public java.lang.Object get(java.lang.Object key)
                     throws java.lang.RuntimeException
Get the object, and return it, throws RuntimeException

Parameters:
key -
Returns:
Object
Throws:
java.lang.RuntimeException

exists

public boolean exists(java.lang.Object key)
returns true if an object exists, else returns false

Parameters:
key -
Returns:
true if an object exists, else returns false

getnext

public java.lang.Object getnext(int i)
                         throws java.lang.RuntimeException
Parameters:
i - index
Returns:
an indexed Object
Throws:
java.lang.RuntimeException

getcount

public int getcount()
Returns:
the count of how many objects