jhplot.io
Class BaseRecordsFile

java.lang.Object
  extended by jhplot.io.BaseRecordsFile
Direct Known Subclasses:
RecordsFile

public abstract class BaseRecordsFile
extends java.lang.Object


Method Summary
 void close()
          Closes the file.
 void deleteRecord(java.lang.String key)
          Deletes a record.
abstract  java.util.Enumeration enumerateKeys()
          Returns an Enumeration of the keys of all records in the database.
abstract  int getNumRecords()
          Returns the number or records in the database.
 void insertRecord(RecordWriter rw)
          Adds the given record to the database.
 RecordReader readRecord(java.lang.String key)
          Reads a record.
abstract  boolean recordExists(java.lang.String key)
          Checks there is a record with the given key.
 void updateRecord(RecordWriter rw)
          Updates an existing record.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
RecordsFileException
java.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:
RecordsFileException
java.io.IOException

readRecord

public RecordReader readRecord(java.lang.String key)
                        throws RecordsFileException,
                               java.io.IOException
Reads a record.

Throws:
RecordsFileException
java.io.IOException

deleteRecord

public void deleteRecord(java.lang.String key)
                  throws RecordsFileException,
                         java.io.IOException
Deletes a record.

Throws:
RecordsFileException
java.io.IOException

close

public void close()
           throws java.io.IOException,
                  RecordsFileException
Closes the file.

Throws:
java.io.IOException
RecordsFileException


jHepWork 2.1 (C) S.Chekanov