Mobios v0.91

mobios.index
Interface Index

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractIndex, VPIndex

public interface Index
extends Serializable

The primary interface for distance-based index. Through Index, the user can build a database index, or read a pre-built index from a file, and then do the search.

Version:
2006.05.09
Author:
Rui Mao, Willard Saint Willard

Method Summary
 void close()
          Closes anything used internally that needs to be closed.
 void destroy()
          Deletes the index from the file, and also release it from memory.
 List<IndexObject> getAllPoints()
          Returns all the data points in the index
 Metric getMetric()
           
 ObjectIOManager getOIOM()
          TODO
 long getRootAddress()
          TODO
 void preLoad(int level)
          When a lot of queries are to be answered, for the sake of performance, it is a good idea to have the top levels of the index tree reside in memory.
 Cursor search(Query query)
          Executes a range query.
 int size()
           
 

Method Detail

getMetric

Metric getMetric()
Returns:
the metric used to build the index.

size

int size()
Returns:
the total number of data objects contained in the index.

preLoad

void preLoad(int level)
When a lot of queries are to be answered, for the sake of performance, it is a good idea to have the top levels of the index tree reside in memory. This method loads the top levels into memory.

Parameters:
level - number of levels, from the root, to be pre-loaded into memory.

search

Cursor search(Query query)
Executes a range query. For a range query (q,r), the results should be all database points satisfying d(q,x)<=r.

Parameters:
query - the Query object
Returns:
a Cursor over the results of the query

getAllPoints

List<IndexObject> getAllPoints()
Returns all the data points in the index


close

void close()
           throws IOException
Closes anything used internally that needs to be closed. It is a good idea to close it when it is no longer in use.

Throws:
IOException

destroy

void destroy()
             throws IOException
Deletes the index from the file, and also release it from memory. This method should only be called when the index will never be used again!

Throws:
IOException

getOIOM

ObjectIOManager getOIOM()
TODO

Returns:

getRootAddress

long getRootAddress()
TODO

Returns:

Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group