downey
Class ReadOnlyDB

java.lang.Object
  extended bydowney.ErrorStore
      extended bydowney.SimpleDB
          extended bydowney.ReadOnlyDB

public class ReadOnlyDB
extends SimpleDB

This class allows for read access to a simple database. It is in a package named downey

The database is stored as a HashMap, so it can store any object. There are some helper functions to assist for changing a String[] to an ArrayList and from an ArrayList to a String[].


Field Summary
 
Fields inherited from class downey.SimpleDB
isOpen, m_database, m_fileName
 
Fields inherited from class downey.ErrorStore
m_strError
 
Constructor Summary
ReadOnlyDB()
           
 
Method Summary
 void eraseDatabase()
          Erasing is disabled in this class.
 void updateRecord(java.lang.String key, java.lang.Object obj)
          Update is disabled in this class.
 
Methods inherited from class downey.SimpleDB
getFileName, init, init, isError, keyIterator, makeArray, makeList, openDatabase, readRecord, saveDatabase, setFileName, valueIterator
 
Methods inherited from class downey.ErrorStore
addError, clearError, getError, setError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyDB

public ReadOnlyDB()
Method Detail

updateRecord

public void updateRecord(java.lang.String key,
                         java.lang.Object obj)
Update is disabled in this class.

Overrides:
updateRecord in class SimpleDB
Parameters:
key - The string used to access that database
obj - The object to be added to the database

It is not necessary to cast the parameter to any type, since all objects are derived from Object.

m_database.updateRecord("fred", record);


eraseDatabase

public void eraseDatabase()
Erasing is disabled in this class.

Overrides:
eraseDatabase in class SimpleDB