net.obsearch.index
Class TestFrameworkLong<O extends OBLong>

java.lang.Object
  extended by net.obsearch.index.TestFrameworkLong<O>
Direct Known Subclasses:
TestFrameworkApproxLong, VectorTestFrameworkLong

public abstract class TestFrameworkLong<O extends OBLong>
extends Object

TestFrameworkLong performs several tests on an index. This generated file works on longs.

Author:
Arnoldo Jose Muller Molina

Field Summary
protected  O[] data
           
protected  IndexLong<O> index
           
protected  O[] queries
           
 
Constructor Summary
TestFrameworkLong(Class<O> type, int dbSize, int querySize, IndexLong<O> index)
          Create a new test with a DB size of dbSize and a query size of querySize.
 
Method Summary
protected  void close()
           
protected  O[] createArray(int size)
          Create an array of size size.
protected  void deletes()
           
protected abstract  O next()
          Create a new object.
protected  O nextQuery()
          Generate an object for the query, defaults #nextO().
protected  void search()
           
 void search(IndexLong<O> index, long range, byte k)
          Perform all the searches with
 void searchSequential(O o, OBPriorityQueueLong<O> result, IndexLong<O> index, long range)
          Sequential search.
 void test()
          Perform all the tests and DB creation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queries

protected O extends OBLong[] queries

data

protected O extends OBLong[] data

index

protected IndexLong<O extends OBLong> index
Constructor Detail

TestFrameworkLong

public TestFrameworkLong(Class<O> type,
                         int dbSize,
                         int querySize,
                         IndexLong<O> index)
Create a new test with a DB size of dbSize and a query size of querySize.

Parameters:
dbSize -
querySize -
index - The index that will be used for testing.
Method Detail

test

public void test()
          throws Exception
Perform all the tests and DB creation.

Throws:
Exception

search

protected void search()
               throws Exception
Throws:
Exception

deletes

protected void deletes()
                throws Exception
Throws:
Exception

close

protected void close()
              throws Exception
Throws:
Exception

search

public void search(IndexLong<O> index,
                   long range,
                   byte k)
            throws Exception
Perform all the searches with

Parameters:
x - the index that will be used
range -
k -
Throws:
Exception

searchSequential

public void searchSequential(O o,
                             OBPriorityQueueLong<O> result,
                             IndexLong<O> index,
                             long range)
                      throws Exception
Sequential search.

Parameters:
o - The object to search
result - The queue were the results are stored
index - the index to search
range - The range to employ
Throws:
Exception - If something goes really bad.

createArray

protected O[] createArray(int size)
Create an array of size size.

Parameters:
size -
Returns:

next

protected abstract O next()
Create a new object.

Returns:
a new O object.

nextQuery

protected O nextQuery()
Generate an object for the query, defaults #nextO().

Returns:
#nextO().


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.