FeatureManager
Class FeatureManager

java.lang.Object
  extended by FeatureManager.FeatureManager
Direct Known Subclasses:
FeatureManagerMySQL, WindsurfFeatureManagerTxt

public abstract class FeatureManager
extends java.lang.Object

Abstract class representing a generic Feature Manager.


Field Summary
protected  long time
          The time (in milliseconds) spent for retrieving features from the DB
 
Constructor Summary
FeatureManager()
          Basic constructor.
 
Method Summary
abstract  void closeConnection()
          Closes the connection to the features DB.
abstract  void closeScan()
          Closes a sequential scan over image features.
 boolean contains(ImageID id)
          Checks whether an image ID is contained in the database.
abstract  void createConnection()
          Connects to the feature DB.
abstract  void createScan()
          Creates a sequential scan over image features.
 long getTime()
          Returns the time spent for retrieving features from the DB.
 Image load(ImageID id)
          Loads the features of an image from the features DB given the image ID.
protected abstract  Image loadFeatures(ImageID id)
          Loads the features of an image from the features DB given the image ID.
protected abstract  Image loadFeaturesNext()
          Loads the features of the next image from the features DB.
 Image loadNext()
          Loads the features of the next image from the features DB.
abstract  ImageID nextID()
          Returns an image ID for a new image.
 void resetTime()
          Resets the time counter.
 boolean save(Image image)
          Saves the features of a given image in the features DB.
protected abstract  boolean saveFeatures(Image image)
          Saves the features of a given image in the features DB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

time

protected long time
The time (in milliseconds) spent for retrieving features from the DB

Constructor Detail

FeatureManager

public FeatureManager()
Basic constructor.

Method Detail

createConnection

public abstract void createConnection()
Connects to the feature DB.


closeConnection

public abstract void closeConnection()
Closes the connection to the features DB.


load

public Image load(ImageID id)
Loads the features of an image from the features DB given the image ID.

Parameters:
id - ID of the image to be loaded.
Returns:
Image object containing loaded features (null if no such image exists).

loadNext

public Image loadNext()
Loads the features of the next image from the features DB.

Returns:
Image object containing loaded features (null if no next image exists).

save

public boolean save(Image image)
Saves the features of a given image in the features DB.

Parameters:
image - Image whose features are to be saved.
Returns:
true if the features have been successfully saved, false otherwise.

saveFeatures

protected abstract boolean saveFeatures(Image image)
Saves the features of a given image in the features DB.

Parameters:
image - Image whose features are to be saved.
Returns:
true if the features have been successfully saved, false otherwise.

loadFeatures

protected abstract Image loadFeatures(ImageID id)
Loads the features of an image from the features DB given the image ID.

Parameters:
id - ID of the image to be loaded.
Returns:
Image object containing loaded features (null if no such image exists).

loadFeaturesNext

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

Returns:
Image object containing loaded features (null if no next image exists).

createScan

public abstract void createScan()
Creates a sequential scan over image features.


closeScan

public abstract void closeScan()
Closes a sequential scan over image features.


nextID

public abstract ImageID nextID()
Returns an image ID for a new image.

Returns:
ImageID object not associated to any DB image.

contains

public boolean contains(ImageID id)
Checks whether an image ID is contained in the database.

Parameters:
id - Image ID to be searched.
Returns:
true if an image with the given ID exists, false otherwise.

getTime

public long getTime()
Returns the time spent for retrieving features from the DB.

Returns:
The time spent for retrieving features from the DB (in milliseconds).

resetTime

public void resetTime()
Resets the time counter.