Package net.i2p.BOB

Class NamedDB


  • public class NamedDB
    extends Object
    Internal database to relate nicknames to options to values
    Author:
    sponge
    • Constructor Detail

      • NamedDB

        public NamedDB()
    • 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)