jhplot.io.db
Class BaseRecordsFile
- java.lang.Object
-
- jhplot.io.db.BaseRecordsFile
-
- Direct Known Subclasses:
- RecordsFile
public abstract class BaseRecordsFile extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidclose()Closes the file.voiddeleteRecord(java.lang.String key)Deletes a record.abstract java.util.EnumerationenumerateKeys()Returns an Enumeration of the keys of all records in the database.abstract intgetNumRecords()Returns the number or records in the database.voidinsertRecord(RecordWriter rw)Adds the given record to the database.RecordReaderreadRecord(java.lang.String key)Reads a record.abstract booleanrecordExists(java.lang.String key)Checks there is a record with the given key.voidupdateRecord(RecordWriter rw)Updates an existing record.
-
-
-
Method Detail
-
enumerateKeys
public abstract java.util.Enumeration enumerateKeys()
Returns an Enumeration of the keys of all records in the database.
-
getNumRecords
public abstract int getNumRecords()
Returns the number or records in the database.
-
recordExists
public abstract boolean recordExists(java.lang.String key)
Checks there is a record with the given key.
-
insertRecord
public void insertRecord(RecordWriter rw) throws RecordsFileException, java.io.IOException
Adds the given record to the database.- Throws:
RecordsFileExceptionjava.io.IOException
-
updateRecord
public void updateRecord(RecordWriter rw) throws RecordsFileException, java.io.IOException
Updates an existing record. If the new contents do not fit in the original record, then the update is handled by deleting the old record and adding the new.- Throws:
RecordsFileExceptionjava.io.IOException
-
readRecord
public RecordReader readRecord(java.lang.String key) throws RecordsFileException, java.io.IOException
Reads a record.- Throws:
RecordsFileExceptionjava.io.IOException
-
deleteRecord
public void deleteRecord(java.lang.String key) throws RecordsFileException, java.io.IOExceptionDeletes a record.- Throws:
RecordsFileExceptionjava.io.IOException
-
close
public void close() throws java.io.IOException, RecordsFileExceptionCloses the file.- Throws:
java.io.IOExceptionRecordsFileException
-
-
DMelt 3.0 © DataMelt by jWork.ORG