marf.Storage
Interface IDatabase

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
Database

public interface IDatabase
extends java.io.Serializable

Subject database interface.

$Id: IDatabase.java,v 1.6 2005/06/12 23:09:37 mokhov Exp $

Since:
0.3.0
Version:
$Revision: 1.6 $
Author:
Serguei Mokhov

Field Summary
static java.lang.String MARF_INTERFACE_CODE_REVISION
          Interface source code revision.
 
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.
 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.
 

Field Detail

MARF_INTERFACE_CODE_REVISION

static final java.lang.String MARF_INTERFACE_CODE_REVISION
Interface source code revision.

See Also:
Constant Field Values
Method Detail

getIDByFilename

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

Parameters:
pstrFileName - Name of a .wav file for which ID must be returned
pbTraining - indicates whether the filename is a training (true) sample or testing (false)
Returns:
int ID, -1 if not found
Throws:
StorageException

getName

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

Parameters:
piID - ID of a subject in the DB to return a name for
Returns:
name string
Throws:
StorageException

connect

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

Throws:
StorageException

query

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

Throws:
StorageException

close

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

Throws:
StorageException