FeatureManager
Class WindsurfFeatureManagerMySQL

java.lang.Object
  extended by FeatureManager.FeatureManager
      extended by FeatureManager.FeatureManagerMySQL
          extended by FeatureManager.WindsurfFeatureManagerMySQL

public class WindsurfFeatureManagerMySQL
extends FeatureManagerMySQL

Implements the MySQL-based Feature Manager for Windsurf.


Field Summary
 
Fields inherited from class FeatureManager.FeatureManagerMySQL
conn, q, rs, table
 
Fields inherited from class FeatureManager.FeatureManager
time
 
Constructor Summary
WindsurfFeatureManagerMySQL(java.lang.String usr, java.lang.String pwd, java.lang.String db, java.lang.String table)
          Basic constructor for a local database.
WindsurfFeatureManagerMySQL(java.lang.String host, java.lang.String port, java.lang.String usr, java.lang.String pwd, java.lang.String db, java.lang.String table)
          Basic constructor for a remote database.
 
Method Summary
 int contains(Image i)
          Checks whether the given image is already contained in the database.
protected  Image createImage(ImageID id, java.sql.ResultSet rs)
          Creates a new Image given the image ID.
protected  java.lang.String imageFeatures2String(Image image)
          Generates a string containing the image features.
protected  Image loadFeaturesNext()
          Loads the features of the next image from the features DB.
 
Methods inherited from class FeatureManager.FeatureManagerMySQL
closeConnection, closeScan, contains, countDBImages, countDBRegions, countRegions, countRegions, createConnection, createScan, loadFeatures, loadRegion, nextID, saveFeatures
 
Methods inherited from class FeatureManager.FeatureManager
getTime, load, loadNext, resetTime, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindsurfFeatureManagerMySQL

public WindsurfFeatureManagerMySQL(java.lang.String usr,
                                   java.lang.String pwd,
                                   java.lang.String db,
                                   java.lang.String table)
Basic constructor for a local database.

Parameters:
usr - Username for the DB connection.
pwd - Password for the DB connection.
db - Name of the features database.
table - Name of the features table.

WindsurfFeatureManagerMySQL

public WindsurfFeatureManagerMySQL(java.lang.String host,
                                   java.lang.String port,
                                   java.lang.String usr,
                                   java.lang.String pwd,
                                   java.lang.String db,
                                   java.lang.String table)
Basic constructor for a remote database.

Parameters:
host - Host name for the DB connection.
port - Port name for the DB connection.
usr - Username for the DB connection.
pwd - Password for the DB connection.
db - Name of the features database.
table - Name of the features table.
Method Detail

createImage

protected Image createImage(ImageID id,
                            java.sql.ResultSet rs)
Creates a new Image given the image ID.

Specified by:
createImage in class FeatureManagerMySQL
Parameters:
id - Image ID.
rs - The result of the issued query.
Returns:
The new WindsurfImage.

loadFeaturesNext

protected Image loadFeaturesNext()
Loads the features of the next image from the features DB.

Specified by:
loadFeaturesNext in class FeatureManager
Returns:
WindsurfImage object containing loaded features (null if no next image exists).

imageFeatures2String

protected java.lang.String imageFeatures2String(Image image)
Generates a string containing the image features.

Specified by:
imageFeatures2String in class FeatureManagerMySQL
Parameters:
image - The image whose features are to be saved.
Returns:
A string containing the features of the image.

contains

public int contains(Image i)
Checks whether the given image is already contained in the database.

Parameters:
i - Requested image.
Returns:
A number representing the ID of an existing image equal to the given image (if such image exists), a negative number otherwise.