|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.obsearch.index.aesa.AbstractAESA<O>
net.obsearch.index.aesa.impl.AesaFloat<O>
public class AesaFloat<O extends OBFloat>
| Nested Class Summary | |
|---|---|
protected class |
AesaFloat.Computation
|
| Field Summary | |
|---|---|
protected static Logger |
logger
|
| Fields inherited from class net.obsearch.index.aesa.AbstractAESA |
|---|
objects, stats |
| Fields inherited from interface net.obsearch.Index |
|---|
ID_SIZE |
| Constructor Summary | |
|---|---|
AesaFloat(Class<O> type,
int expectedSize)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the database. |
String |
debug(O object)
Routine that helps to debug objects. |
OperationStatus |
delete(O object)
Deletes the given object from the database. |
OperationStatus |
exists(O object)
Returns true if the given object exists in the database. |
float[] |
fullMatchLite(O query,
boolean filterSame)
This method returns a list of all the distances of the query against the DB. |
long |
getBox(O object)
Returns the box where the given object is stored. |
O |
getObject(long i)
This method returns the object with internal id "i". |
Statistics |
getStats()
|
void |
init(OBStoreFactory fact)
This method *must* be called after de-serializing the database object and after instantiating the index. |
OperationStatus |
insert(O object,
long id)
Inserts the given object into the index. |
OperationStatus |
insertBulk(O object)
Inserts the given object into the index. |
OperationStatus |
insertBulk(O object,
long id)
Inserts the given object into the index. |
boolean |
isFrozen()
Returns true if the index is frozen. |
void |
prepare()
compute all the distances |
void |
searchOB(OBQueryFloat<O> query)
|
void |
searchOB(O object,
float r,
Filter<O> filter,
OBPriorityQueueFloat<O> result)
Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object". |
void |
searchOB(O object,
float r,
OBPriorityQueueFloat<O> result)
Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object". |
void |
setPreFreezeCheck(boolean preFreezeCheck)
If the index should check for existent objects before freeze. |
long |
totalBoxes()
Returns the total number of boxes this index can hold. |
| Methods inherited from class net.obsearch.index.aesa.AbstractAESA |
|---|
databaseSize, freeze, get, getStatistics, getType, insert, loadObject, resetStats, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.obsearch.Index |
|---|
databaseSize, freeze, getType, insert, loadObject, resetStats |
| Field Detail |
|---|
protected static Logger logger
| Constructor Detail |
|---|
public AesaFloat(Class<O> type,
int expectedSize)
| Method Detail |
|---|
public void prepare()
throws OBException
AbstractAESA
prepare in class AbstractAESA<O extends OBFloat>OBException
public float[] fullMatchLite(O query,
boolean filterSame)
throws OBException,
IllegalAccessException,
InstantiationException
fullMatchLite in interface IndexFloat<O extends OBFloat>query - filterSame - if True we do not return objects o such that query.equals(o)
OBException
InstantiationException
IllegalAccessException
public void searchOB(OBQueryFloat<O> query)
throws OBException,
InstantiationException,
IllegalAccessException
OBException
InstantiationException
IllegalAccessException
public void searchOB(O object,
float r,
OBPriorityQueueFloat<O> result)
throws NotFrozenException,
InstantiationException,
IllegalIdException,
IllegalAccessException,
OutOfRangeException,
OBException
IndexFloat
searchOB in interface IndexFloat<O extends OBFloat>object - The object that has to be searchedr - The range to be usedresult - A priority queue that will hold the result
NotFrozenException - if the index has not been frozen.
InstantiationException - If there is a problem when instantiating objects O
IllegalIdException - This exception is left as a Debug flag. If you receive
this exception please report the problem to:
http://code.google.com/p/obsearch/issues/list
IllegalAccessException - If there is a problem when instantiating objects O
OutOfRangeException - If the distance of any object to any other object exceeds
the range defined by the user.
OBException - User generated exception
public void searchOB(O object,
float r,
Filter<O> filter,
OBPriorityQueueFloat<O> result)
throws NotFrozenException,
InstantiationException,
IllegalIdException,
IllegalAccessException,
OutOfRangeException,
OBException
IndexFloat
searchOB in interface IndexFloat<O extends OBFloat>object - The object that has to be searchedr - The range to be usedresult - A priority queue that will hold the result
NotFrozenException - if the index has not been frozen.
InstantiationException - If there is a problem when instantiating objects O
IllegalIdException - This exception is left as a Debug flag. If you receive
this exception please report the problem to:
http://code.google.com/p/obsearch/issues/list
IllegalAccessException - If there is a problem when instantiating objects O
OutOfRangeException - If the distance of any object to any other object exceeds
the range defined by the user.
OBException - User generated exception
public void close()
throws OBException
Index
close in interface Index<O extends OBFloat>OBStorageException - If something goes wrong with the DB.
OBException
public String debug(O object)
throws OBException,
InstantiationException,
IllegalAccessException
Index
debug in interface Index<O extends OBFloat>OBException
InstantiationException
IllegalAccessException
public OperationStatus delete(O object)
throws OBStorageException,
OBException,
IllegalAccessException,
InstantiationException,
NotFrozenException
Index
delete in interface Index<O extends OBFloat>object - The object to be deleted
Status.OK and the deleted object's id
if the object was found and successfully deleted.
Status.NOT_EXISTS if the object is not
in the database.
OBStorageException - If something goes wrong with the DB
NotFrozenException - if the index has not been frozen.
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
public OperationStatus exists(O object)
throws OBStorageException,
OBException,
IllegalAccessException,
InstantiationException
Index
exists in interface Index<O extends OBFloat>object - The object that will be searched.
Status.EXISTS and the object's id if
the object exists in the database, otherwise
Status.NOT_EXISTS is returned.
OBStorageException - If something goes wrong with the DB
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
public long getBox(O object)
throws OBException
Index
getBox in interface Index<O extends OBFloat>object - The object to be analyzed
OBException - User generated exception
public O getObject(long i)
throws IllegalIdException,
IllegalAccessException,
InstantiationException,
OBException
Index
getObject in interface Index<O extends OBFloat>i - The id to be retrieved
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
OBStorageException - If something goes wrong with the DB
OBException - User generated exception
IllegalIdException
public Statistics getStats()
throws OBStorageException
getStats in interface Index<O extends OBFloat>OBStorageException
public void init(OBStoreFactory fact)
throws OBStorageException,
NotFrozenException,
IllegalAccessException,
InstantiationException,
OBException,
IOException
Index#org.obsearch.ambient.Ambient, users
do not need to worry about this method.
init in interface Index<O extends OBFloat>fact - The storage factory that will be used to store the data.
OBStorageException - If something goes wrong with the DB
NotFrozenException - if the index has not been frozen.
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
OBException - User generated exception
IOException - if the index serialization process fails
public OperationStatus insert(O object,
long id)
throws OBStorageException,
OBException,
IllegalAccessException,
InstantiationException
Index
insert in interface Index<O extends OBFloat>object - The object to be added.id - The id that will be used for the object.
Status.OK or
Status.EXISTS then the result will hold
the id of the inserted object and the operation is successful.
Otherwise an exception will be thrown.
OBStorageException - If something goes wrong with the DB
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
public OperationStatus insertBulk(O object)
throws OBStorageException,
OBException,
IllegalAccessException,
InstantiationException
Index
insertBulk in interface Index<O extends OBFloat>object - The object to be added.
Status.OK
OBStorageException - If something goes wrong with the DB
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects O
public OperationStatus insertBulk(O object,
long id)
throws OBStorageException,
OBException,
IllegalAccessException,
InstantiationException
Index
insertBulk in interface Index<O extends OBFloat>object - The object to be added.id - The id that will be used for the object.
Status.OK
OBStorageException - If something goes wrong with the DB
OBException - User generated exception
IllegalAccessException - If there is a problem when instantiating objects O
InstantiationException - If there is a problem when instantiating objects Opublic boolean isFrozen()
Index
isFrozen in interface Index<O extends OBFloat>public void setPreFreezeCheck(boolean preFreezeCheck)
Index
setPreFreezeCheck in interface Index<O extends OBFloat>preFreezeCheck - Set the flag.public long totalBoxes()
Index
totalBoxes in interface Index<O extends OBFloat>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||