db
Class PersistentHashtable

java.lang.Object
  |
  +--db.PersistentHashtable
Direct Known Subclasses:
MPHashtable

public class PersistentHashtable
extends java.lang.Object

PersistentHashtable implements persistent Hashtable on disk. Both key and value are strings. Uses Unix utility ndbm.


Constructor Summary
PersistentHashtable(java.io.File file)
           
PersistentHashtable(java.lang.String fn)
           
 
Method Summary
 void delete()
          deletes the whole DB
 java.util.Enumeration elements()
           
 java.lang.String firstKey()
           
 void free()
          Clear some disk space
 java.lang.String get(java.lang.String key)
          Legge un valore dalla PersistentHashtable.
 boolean isEmpty()
           
 java.util.Enumeration keys()
           
static void main(java.lang.String[] args)
          La classe puo' essere utilizzata a linea di comando per il testing.
 boolean put(java.lang.String key, java.lang.String value)
          Scrive una coppia sulla PersistentHashtable.
 java.lang.String remove(java.lang.String key)
          Elimina una chiave dalla PersistentHashtable.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentHashtable

public PersistentHashtable(java.lang.String fn)

PersistentHashtable

public PersistentHashtable(java.io.File file)
Method Detail

elements

public java.util.Enumeration elements()

get

public java.lang.String get(java.lang.String key)
Legge un valore dalla PersistentHashtable.

isEmpty

public boolean isEmpty()

keys

public java.util.Enumeration keys()

put

public boolean put(java.lang.String key,
                   java.lang.String value)
Scrive una coppia sulla PersistentHashtable.
Returns:
true se l'operazione ha successo.

remove

public java.lang.String remove(java.lang.String key)
Elimina una chiave dalla PersistentHashtable.

size

public int size()

free

public void free()
Clear some disk space

firstKey

public java.lang.String firstKey()
Returns:
first key present in table, null if table is empty.

delete

public void delete()
deletes the whole DB

main

public static void main(java.lang.String[] args)
La classe puo' essere utilizzata a linea di comando per il testing.