All Packages Class Hierarchy This Package Previous Next Index
Class cube.database.Dbm
java.lang.Object
|
+----cube.database.Dbm
- public class Dbm
- extends Object
This class encapsulates the interface to a dbm file, in this case gdbm.
It is adapted from jdbm.java (c) COPYRIGHT MIT and INRIA, 1996.
This is a fake dbm-like database interface to the jdbm package which is a real
java interface to gdbm (you'll have to grab jdbm/gdbm from elsewhere).
For more information on the cube see the cube
Overview.
Copyright © 1997 Curtis E. Dyreson. All rights reserved.
Please be aware of the
Licence
and
Version.
- See Also:
- Table, Tuple
-
Dbm(String)
- Create a new Dbm file.
-
delete(byte[])
- Delete the association for the provided key.
-
keys()
- Enumerate the keys of this database.
-
lookup(byte[])
- Lookup the value associated with the provided key.
-
save()
- Save thisdatabase to disk, do nothing!
-
size()
- Number of tuples in the table.
-
store(byte[], byte[])
- Store the given association of key/value.
Dbm
public Dbm(String fileName)
- Create a new Dbm file.
store
public void store(byte key[],
byte value[])
- Store the given association of key/value. Always stores in replace mode.
- Parameters:
- key - The bytes that makes the key.
- value - The bytes that makes the value.
- mode - The mode of the storing, can be...
lookup
public byte[] lookup(byte key[])
- Lookup the value associated with the provided key.
- Parameters:
- key - The bits of the key to look for.
- Returns:
- The bits that makes the associated value, or
null if not found.
delete
public boolean delete(byte key[])
- Delete the association for the provided key.
- Parameters:
- key - The key of the element to remove.
- Returns:
- A boolean true if deletion was succesfull.
size
public int size()
- Number of tuples in the table.
save
public void save()
- Save thisdatabase to disk, do nothing!
keys
public Enumeration keys()
- Enumerate the keys of this database.
- Returns:
- An enumeration instance.
All Packages Class Hierarchy This Package Previous Next Index