com.equitysoft.hashstore
Class SyncDiskHashtable

java.lang.Object
  |
  +--com.equitysoft.hashstore.DiskHashtable
        |
        +--com.equitysoft.hashstore.SyncDiskHashtable

public class SyncDiskHashtable
extends DiskHashtable

This class is a convenience class that is a synchronized version of DiskHashtable.

Author:
Colin Mummery - equitysoft@iname.com - http://www.kagi.com/equitysoft

Constructor Summary
SyncDiskHashtable(java.io.File root)
           
 
Method Summary
 boolean containsKey(java.lang.Object key)
          Returns true if the key exists in the hashtable otherwise false.
 java.lang.Object get(java.lang.Object key)
          Retrieves the object associated with the key in the hashtable.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Stores the key and value pair in the hashtable.
 java.lang.Object remove(java.lang.Object key)
          Removes the key and value pair in the hashtable associated with the given key.
 
Methods inherited from class com.equitysoft.hashstore.DiskHashtable
clear, deleteTable, elements, isEmpty, keys, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncDiskHashtable

public SyncDiskHashtable(java.io.File root)
Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
                     throws java.io.IOException
Stores the key and value pair in the hashtable. If the key value already exists then the value if replaced and the old value is returned otherwise the method returns null.
Overrides:
put in class DiskHashtable
Following copied from class: com.equitysoft.hashstore.DiskHashtable
Returns:
The original value for the key if it already exists

get

public java.lang.Object get(java.lang.Object key)
                     throws java.io.IOException
Retrieves the object associated with the key in the hashtable. If the key doesn't exist then the method returns null.
Overrides:
get in class DiskHashtable
Following copied from class: com.equitysoft.hashstore.DiskHashtable
Returns:
null if the key isn't found otherwise the associated object

remove

public java.lang.Object remove(java.lang.Object key)
                        throws java.io.IOException
Removes the key and value pair in the hashtable associated with the given key. If the key value exists then the associated value is returned otherwise the method returns null.
Overrides:
remove in class DiskHashtable
Following copied from class: com.equitysoft.hashstore.DiskHashtable
Returns:
The Object associated with the key removed

containsKey

public boolean containsKey(java.lang.Object key)
                    throws java.io.IOException
Returns true if the key exists in the hashtable otherwise false.
Overrides:
containsKey in class DiskHashtable
Following copied from class: com.equitysoft.hashstore.DiskHashtable
Returns:
true if the key exists