FileDocCategorySizeDatePackage
AbstractQueryMaker.javaAPI DocApache Lucene 2.2.02167Sat Jun 16 22:20:58 BST 2007org.apache.lucene.benchmark.byTask.feeds

AbstractQueryMaker

public abstract class AbstractQueryMaker extends Object implements QueryMaker
Abstract base query maker. Each query maker should just implement the {@link #prepareQueries()} method.

Fields Summary
protected int
qnum
protected Query[]
queries
protected org.apache.lucene.benchmark.byTask.utils.Config
config
Constructors Summary
Methods Summary
public org.apache.lucene.search.QuerymakeQuery()

    return queries[nextQnum()];
  
public org.apache.lucene.search.QuerymakeQuery(int size)

    throw new Exception(this+".makeQuery(int size) is not supported!");
  
protected synchronized intnextQnum()

    int res = qnum;
    qnum = (qnum+1) % queries.length;
    return res;
  
protected abstract org.apache.lucene.search.Query[]prepareQueries()

public java.lang.StringprintQueries()

    String newline = System.getProperty("line.separator");
    StringBuffer sb = new StringBuffer();
    if (queries != null) {
      for (int i = 0; i < queries.length; i++) {
        sb.append(i+". "+ Format.simpleName(queries[i].getClass())+" - "+queries[i].toString());
        sb.append(newline);
      }
    }
    return sb.toString();
  
public voidresetInputs()


     
    qnum = 0;
  
public voidsetConfig(org.apache.lucene.benchmark.byTask.utils.Config config)

    this.config = config;
    queries = prepareQueries();