jhplot.io.db
Class RecordsFile
- java.lang.Object
-
- jhplot.io.db.BaseRecordsFile
-
- jhplot.io.db.RecordsFile
-
public class RecordsFile extends BaseRecordsFile
-
-
Constructor Summary
Constructors Constructor and Description RecordsFile(java.lang.String dbPath, int initialSize)
Creates a new database file.RecordsFile(java.lang.String dbPath, java.lang.String accessFlags)
Opens an existing database and initializes the in-memory index.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
Closes the database.java.util.Enumeration
enumerateKeys()
Returns an enumeration of all the keys in the database.int
getNumRecords()
Returns the current number of records in the database.boolean
recordExists(java.lang.String key)
Checks if there is a record belonging to the given key.-
Methods inherited from class jhplot.io.db.BaseRecordsFile
deleteRecord, insertRecord, readRecord, updateRecord
-
-
-
-
Constructor Detail
-
RecordsFile
public RecordsFile(java.lang.String dbPath, int initialSize) throws java.io.IOException, RecordsFileException
Creates a new database file. The initialSize parameter determines the amount of space which is allocated for the index. The index can grow dynamically, but the parameter is provide to increase efficiency.- Throws:
java.io.IOException
RecordsFileException
-
RecordsFile
public RecordsFile(java.lang.String dbPath, java.lang.String accessFlags) throws java.io.IOException, RecordsFileException
Opens an existing database and initializes the in-memory index.- Throws:
java.io.IOException
RecordsFileException
-
-
Method Detail
-
enumerateKeys
public java.util.Enumeration enumerateKeys()
Returns an enumeration of all the keys in the database.- Specified by:
enumerateKeys
in classBaseRecordsFile
-
getNumRecords
public int getNumRecords()
Returns the current number of records in the database.- Specified by:
getNumRecords
in classBaseRecordsFile
-
recordExists
public boolean recordExists(java.lang.String key)
Checks if there is a record belonging to the given key.- Specified by:
recordExists
in classBaseRecordsFile
-
close
public void close() throws java.io.IOException, RecordsFileException
Closes the database.- Overrides:
close
in classBaseRecordsFile
- Throws:
java.io.IOException
RecordsFileException
-
-
DMelt 3.0 © DataMelt by jWork.ORG