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

Constructor Index

 o Dbm(String)
Create a new Dbm file.

Method Index

 o delete(byte[])
Delete the association for the provided key.
 o keys()
Enumerate the keys of this database.
 o lookup(byte[])
Lookup the value associated with the provided key.
 o save()
Save thisdatabase to disk, do nothing!
 o size()
Number of tuples in the table.
 o store(byte[], byte[])
Store the given association of key/value.

Constructors

 o Dbm
  public Dbm(String fileName)
Create a new Dbm file.

Methods

 o 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...
 o 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.
 o 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.
 o size
  public int size()
Number of tuples in the table.

 o save
  public void save()
Save thisdatabase to disk, do nothing!

 o keys
  public Enumeration keys()
Enumerate the keys of this database.

Returns:
An enumeration instance.

All Packages  Class Hierarchy  This Package  Previous  Next  Index