Documentation API of the '' Java class

Class HDataBase

  • public class HDataBaseextends Object
    This raw-level database allows to store and retrieve objects. It associates a key of type String with each record. The keys will be limited to a maximum length, although the record data will not be limited. The record will consist of only one "blob" of binary data. The number of records is not fixed at creation time. The file can grow and shrink as records are inserted and removed. Because our index and record data will be stored in the same file, this restriction will cause us to add extra logic to dynamically increase the index space by reorganizing records. The database operations not depend on the number of records in the file. In other words, they'll be of constant order time with respect to file accesses. The index is small enough to load into memory. This will make it easier for our implementation to fulfill the requirement that dictates access time. The code is based on:
    • Constructor Detail

      • HDataBase

        public HDataBase(String file,                 String option)
        Create a new persistent database. If file exists, and the option "w" is set, the old file will be removed!
        file - File name
        option - Option to create the file . If "w" - write a file (or read) file, if "r" only read created file.
      • HDataBase

        public HDataBase(String file)
        Open the database file for reading.
        file - File name
    • Method Detail

      • getKeys

        public Enumeration getKeys()
        Returns an enumeration of all the keys in the database.
      • getRecords

        public int getRecords()
        Returns the current number of records in the database.
      • isExists

        public boolean isExists(String key)
        Checks if there is a record belonging to the given key.
      • insert

        public boolean insert(String key,                      Object obj)
        Insert an object with a key
        key - key for object
        obj - Object for this key
        true if success
      • get

        public Object get(String key)
        Get object from the database using a key
        key - Key to get the object
      • update

        public boolean update(Object ob,                      String key)
        Update the database with a new value
        ob - Object
        key - key
        true if success
      • remove

        public boolean remove(String key)
        Remove object from the database using the key
        key - input key
        true if success
      • close

        public boolean close()
        Close the file

DataMelt 1.1 © jWork.ORG

Warning: You see this message because an access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To enable the description of all Java classes of dataMelt, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.