|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object FeatureManager.FeatureManager FeatureManager.FeatureManagerMySQL
public abstract class FeatureManagerMySQL
Implements the MySQL-based Feature Manager.
Field Summary | |
---|---|
protected MySQLConnector |
conn
The DB connection |
protected MySQLQuery |
q
The last SQL query |
protected java.sql.ResultSet |
rs
Result of last SQL query |
protected java.lang.String |
table
Name of the features table in the database |
Fields inherited from class FeatureManager.FeatureManager |
---|
time |
Constructor Summary | |
---|---|
FeatureManagerMySQL(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. |
Method Summary | |
---|---|
void |
closeConnection()
Closes the connection to the features DB. |
void |
closeScan()
Closes a sequential scan over image features. |
boolean |
contains(ImageID id)
Checks whether an image ID is contained in the database. |
int |
countDBImages()
Returns the number of images in the feature DB. |
int |
countDBRegions()
Returns the number of regions in the feature DB. |
int |
countRegions(ImageID id)
Returns the number of regions of the image with a given ID. |
int |
countRegions(java.lang.String parameters)
Returns the total number of regions in the features DB. |
void |
createConnection()
Connects to the feature DB. |
protected abstract Image |
createImage(ImageID id,
java.sql.ResultSet rs)
Creates a new Image given the image ID from the result of a query. |
void |
createScan()
Creates a sequential scan over image features. |
protected abstract java.lang.String |
imageFeatures2String(Image image)
Generates a string containing the image features. |
protected Image |
loadFeatures(ImageID id)
Loads the features of an image from the features DB given the image ID. |
Region |
loadRegion(ImageID id)
Loads the features of a region from the features DB given the (global) region ID. |
ImageID |
nextID()
Returns an image ID for a new image. |
protected boolean |
saveFeatures(Image image)
Saves the features of a given image in the features DB. |
Methods inherited from class FeatureManager.FeatureManager |
---|
getTime, load, loadFeaturesNext, loadNext, resetTime, save |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MySQLConnector conn
protected MySQLQuery q
protected java.sql.ResultSet rs
protected java.lang.String table
Constructor Detail |
---|
public FeatureManagerMySQL(java.lang.String host, java.lang.String port, java.lang.String usr, java.lang.String pwd, java.lang.String db, java.lang.String table)
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 |
---|
public void createConnection()
createConnection
in class FeatureManager
public void closeConnection()
closeConnection
in class FeatureManager
public void createScan()
createScan
in class FeatureManager
public void closeScan()
closeScan
in class FeatureManager
public int countDBImages()
public int countDBRegions()
public ImageID nextID()
nextID
in class FeatureManager
ImageIDnumerical
object not associated to any DB image.protected boolean saveFeatures(Image image)
saveFeatures
in class FeatureManager
image
- Image whose features are to be saved.
true
if the features have been successfully saved, false
otherwise.protected abstract java.lang.String imageFeatures2String(Image image)
image
- The image whose features are to be saved.
protected Image loadFeatures(ImageID id)
loadFeatures
in class FeatureManager
id
- ID of the image to be loaded.
Image
object containing loaded features (null
if no such image exists).protected abstract Image createImage(ImageID id, java.sql.ResultSet rs)
Image
given the image ID from the result of a query.
id
- Image ID.rs
- The result of the issued query.
Image
.public boolean contains(ImageID id)
contains
in class FeatureManager
id
- Image ID to be searched.
true
if an image with the given ID exists, false
otherwise.public int countRegions(ImageID id)
id
- ID of the image to be searched.
public int countRegions(java.lang.String parameters)
parameters
- Additional "WHERE" clause for the counting query.
public Region loadRegion(ImageID id)
id
- Global ID of the region to be loaded.
Region
object containing loaded features (null
if no such region exist).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |