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 and Description
`NamedDB()` make initial NULL object

### Method Summary

Methods
`void` `add(Object key, Object val)` Add object to the array, deletes the old one if it exists
`boolean` `exists(Object key)` returns true if an object exists, else returns false
`Object` `get(Object key)` Get the object, and return it, throws RuntimeException
`int` `getcount()`
`Object` `getnext(int i)`
`void` `getReadLock()`
`void` `getWriteLock()`
`int` `idx(Object key)` Find objects in the array, returns it's index or throws exception
`void` `kill(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(Object key)
            throws ArrayIndexOutOfBoundsException

Find objects in the array, returns it's index or throws exception

Parameters:
  `key` -
Returns:
  an objects index
Throws:
  `ArrayIndexOutOfBoundsException` - when key does not exist

#### kill

    public void kill(Object key)

Delete an object from array if it exists

Parameters:
  `key` -

#### add

    public void add(Object key,
           Object val)

Add object to the array, deletes the old one if it exists

Parameters:
  `key` -
  `val` -

#### get

    public Object get(Object key)
               throws RuntimeException

Get the object, and return it, throws RuntimeException

Parameters:
  `key` -
Returns:
  Object
Throws:
  `RuntimeException`

#### exists

    public boolean exists(Object key)

returns true if an object exists, else returns false

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

#### getnext

    public Object getnext(int i)
                   throws RuntimeException

Parameters:
  `i` - index
Returns:
  an indexed Object
Throws:
  `RuntimeException`

#### getcount

    public int getcount()

Returns:
  the count of how many objects