Index
Class WrapperIndexWindsurf

java.lang.Object
  extended by Index.WrapperIndexWindsurf

public class WrapperIndexWindsurf
extends java.lang.Object

Implements the interface for managing indices. Implements an utility class for managing Windsurf/M-tree indices.


Field Summary
protected static IndexInterface ind
          The Index Interface
protected static WrapperFeatureWindsurfMySQL wf
          The Feature Manager Wrapper
 
Constructor Summary
WrapperIndexWindsurf()
           
 
Method Summary
static boolean createIndex(boolean isImage, java.lang.String file)
          Creates a new index using features stored in a DB.
static boolean createIndexBIN(boolean isImage, java.lang.String file)
          Creates a new index using features stored in a text file.
static boolean createIndexTXT(boolean isImage, java.lang.String file)
          Saves features data on a text file for later creation of an index.
static boolean deleteImage(Document.ImageID id)
          Deletes an image from the image index.
static boolean deleteRegion(Document.ImageID id)
          Deletes a region from the region index.
static IndexManager.ImgIndexManager imageIndexManager()
          Creates and returns a Manager for an image index.
static void init(java.lang.String imageIndex, java.lang.String regionIndex, WrapperFeatureWindsurfMySQL wf)
          Initializes the Index Interface.
static boolean insertAllRegions(Document.ImageID id)
          Inserts all regions of a given image in the region index.
static boolean insertNewImage(Document.ImageID id)
          Inserts a new image in the image index.
static boolean insertNewRegion(Document.ImageID id)
          Inserts a new region in the region index.
static java.util.Vector<QueryProcessor.SF.ScoredResultImage> kNNQuery(Document.ImageID id, int k)
          Performs a k-NN query for a given image.
static java.util.Vector<QueryProcessor.SF.ScoredResultImage> rangeQuery(Document.ImageID id, double r)
          Performs a range query for a given image.
static IndexManager.RegIndexManager regionIndexManager()
          Creates and returns a Manager for a region index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ind

protected static IndexInterface ind
The Index Interface


wf

protected static WrapperFeatureWindsurfMySQL wf
The Feature Manager Wrapper

Constructor Detail

WrapperIndexWindsurf

public WrapperIndexWindsurf()
Method Detail

init

public static void init(java.lang.String imageIndex,
                        java.lang.String regionIndex,
                        WrapperFeatureWindsurfMySQL wf)
Initializes the Index Interface.

Parameters:
imageIndex - Path of image index.
regionIndex - Path of region index.
wf - The Feature Manager Wrapper.

createIndex

public static boolean createIndex(boolean isImage,
                                  java.lang.String file)
Creates a new index using features stored in a DB.

Parameters:
isImage - If true creates a image index, otherwise creates a region index.
file - Path of the temporary text file to be used for creating the index.
Returns:
true if the index was successfully created, false otherwise.

createIndexTXT

public static boolean createIndexTXT(boolean isImage,
                                     java.lang.String file)
Saves features data on a text file for later creation of an index.

Parameters:
isImage - If true extracts image features, otherwise extracts region features.
file - Path of the text file to be used for creating the index.
Returns:
true if the text file was successfully created, false otherwise.

createIndexBIN

public static boolean createIndexBIN(boolean isImage,
                                     java.lang.String file)
Creates a new index using features stored in a text file.

Parameters:
isImage - If true creates a image index, otherwise creates a region index.
file - Path of the temporary text file to be used for creating the index.
Returns:
true if the index was successfully created, false otherwise.

imageIndexManager

public static IndexManager.ImgIndexManager imageIndexManager()
Creates and returns a Manager for an image index.

Returns:
A Manager for an image index.

regionIndexManager

public static IndexManager.RegIndexManager regionIndexManager()
Creates and returns a Manager for a region index.

Returns:
A Manager for a region index.

insertNewImage

public static boolean insertNewImage(Document.ImageID id)
Inserts a new image in the image index.

Parameters:
id - ID of the image to be inserted.
Returns:
true if the image was successfully inserted, false otherwise.

deleteImage

public static boolean deleteImage(Document.ImageID id)
Deletes an image from the image index.

Parameters:
id - ID of the image to be deleted.
Returns:
true if the image was successfully deleted, false otherwise.

insertAllRegions

public static boolean insertAllRegions(Document.ImageID id)
Inserts all regions of a given image in the region index.

Parameters:
id - ID of the image whose regions are to be inserted.
Returns:
true if the regions were successfully inserted, false otherwise.

insertNewRegion

public static boolean insertNewRegion(Document.ImageID id)
Inserts a new region in the region index.

Parameters:
id - ID of the region to be inserted.
Returns:
true if the region was successfully inserted, false otherwise.

deleteRegion

public static boolean deleteRegion(Document.ImageID id)
Deletes a region from the region index.

Parameters:
id - ID of the region to be deleted.
Returns:
true if the region was successfully deleted, false otherwise.

kNNQuery

public static java.util.Vector<QueryProcessor.SF.ScoredResultImage> kNNQuery(Document.ImageID id,
                                                                             int k)
Performs a k-NN query for a given image.

Parameters:
id - ID of the query image.
k - Number of requested results.
Returns:
A vector of ScoredResultImages, or null if the query image does not exist.

rangeQuery

public static java.util.Vector<QueryProcessor.SF.ScoredResultImage> rangeQuery(Document.ImageID id,
                                                                               double r)
Performs a range query for a given image.

Parameters:
id - ID of the query image.
r - Maximum distance value.
Returns:
A vector of ScoredResultImages, or null if the query image does not exist.