edu.stanford.nlp.database
Class SLJDB

java.lang.Object
  |
  +--edu.stanford.nlp.database.AbstractSimpleDatabase
        |
        +--edu.stanford.nlp.database.SLJDB
All Implemented Interfaces:
SimpleDatabase

public class SLJDB
extends AbstractSimpleDatabase

Simple Lightweight Java Database. SimpleDatabase Wrapper for JDBM: Sourcefourge Open Source Java clone for GDBM.


Constructor Summary
SLJDB(String file)
           
 
Method Summary
 void close()
          Closes the database for read and write
 Object get(Object key)
          Gets Object from database
 Iterator keys()
          Returns an Iterator over keys in database
 void open()
          Opens the database for read and write
 void put(Object key, Object value)
          Inserts Object into database
 void remove(Object key)
          Removes Object from database
 int size()
          Returns number of elements in database (slow implementation).
 String toString()
          Returns String representation of database in the form below.
 String toXMLString()
          Returns an XML representation of database.
 Iterator values()
          Returns an Iterator over values in database
 
Methods inherited from class edu.stanford.nlp.database.AbstractSimpleDatabase
toVerboseString, toVerboseXMLString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SLJDB

public SLJDB(String file)
      throws IOException
Method Detail

open

public void open()
          throws IOException
Opens the database for read and write

IOException

close

public void close()
           throws IOException
Closes the database for read and write

IOException

size

public int size()
Returns number of elements in database (slow implementation). Warning: does not store size, so in order to find size, it iterates through the entire database, which could be long.


put

public void put(Object key,
                Object value)
         throws IOException
Description copied from interface: SimpleDatabase
Inserts Object into database

IOException

get

public Object get(Object key)
           throws IOException
Description copied from interface: SimpleDatabase
Gets Object from database

IOException

remove

public void remove(Object key)
            throws IOException
Description copied from interface: SimpleDatabase
Removes Object from database

IOException

toString

public String toString()
Returns String representation of database in the form below. filename: sample.db
type: SLJDB

Specified by:
toString in interface SimpleDatabase
Overrides:
toString in class Object

toXMLString

public String toXMLString()
Description copied from interface: SimpleDatabase
Returns an XML representation of database. Often it will be of the form: /nlp/sdkamvar/sample.db SLJDB


keys

public Iterator keys()
Description copied from interface: SimpleDatabase
Returns an Iterator over keys in database


values

public Iterator values()
Description copied from interface: SimpleDatabase
Returns an Iterator over values in database



Stanford NLP Group