Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

marf.Storage
Class Database  view Database download Database.java

java.lang.Object
  extended bymarf.Storage.StorageManager
      extended bymarf.Storage.Database
All Implemented Interfaces:
IDatabase, IStorageManager, java.io.Serializable

public class Database
extends StorageManager
implements IDatabase

Subject database. To be used by an application to contain information about known subjects (speakers, instruments, languages, etc).

Since:
0.3.0
Version:
$Revision: 1.9 $

Field Summary
protected  boolean bConnected
          Indicates whether we are connected or not.
private static long serialVersionUID
          For serialization versioning.
 
Fields inherited from class marf.Storage.StorageManager
bDumpOnNotFound, iCurrentDumpMode, oObjectToSerialize, strFilename
 
Fields inherited from interface marf.Storage.IDatabase
MARF_INTERFACE_CODE_REVISION
 
Fields inherited from interface marf.Storage.IStorageManager
DUMP_BINARY, DUMP_CSV_TEXT, DUMP_GZIP_BINARY, DUMP_HTML, DUMP_SQL, DUMP_XML, MARF_INTERFACE_CODE_REVISION, STORAGE_FILE_EXTENSIONS
 
Constructor Summary
Database()
          Default constructor with the StorageManager.
 
Method Summary
 void close()
          Closes (file) database connection.
 void connect()
          Connects to the database of subjects.
 int getIDByFilename(java.lang.String pstrFileName, boolean pbTraining)
          Given ID, fetches the corresponding filename.
static java.lang.String getMARFSourceCodeRevision()
          Returns source code revision information.
 java.lang.String getName(int piID)
          Retrieves subject's name by their ID.
 void query()
          Retrieves subject's data from the database and populates internal data structures.
 
Methods inherited from class marf.Storage.StorageManager
backSynchronizeObject, dump, dumpBinary, dumpCSV, dumpGzipBinary, dumpHTML, dumpSQL, dumpXML, enableDumpOnNotFound, getDefaultExtension, getDefaultExtension, getDumpMode, getFilename, restore, restoreBinary, restoreCSV, restoreGzipBinary, restoreHTML, restoreSQL, restoreXML, setDumpMode, setFilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bConnected

protected boolean bConnected
Indicates whether we are connected or not.


serialVersionUID

private static final long serialVersionUID
For serialization versioning. When adding new members or make other structural changes regenerate this number with the serialver tool that comes with JDK.

Since:
0.3.0.4
See Also:
Constant Field Values
Constructor Detail

Database

public Database()
Default constructor with the StorageManager.

Method Detail

getIDByFilename

public int getIDByFilename(java.lang.String pstrFileName,
                           boolean pbTraining)
                    throws StorageException
Given ID, fetches the corresponding filename. Retrieves Speaker's ID by a sample filename.

Specified by:
getIDByFilename in interface IDatabase

getName

public java.lang.String getName(int piID)
                         throws StorageException
Retrieves subject's name by their ID.

Specified by:
getName in interface IDatabase

connect

public void connect()
             throws StorageException
Connects to the database of subjects.

Specified by:
connect in interface IDatabase

query

public void query()
           throws StorageException
Retrieves subject's data from the database and populates internal data structures.

Specified by:
query in interface IDatabase

close

public void close()
           throws StorageException
Closes (file) database connection.

Specified by:
close in interface IDatabase

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Returns source code revision information.