package clucene;
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


public class Searcher extends Searchable {
  private long swigCPtr;

  protected Searcher(long cPtr, boolean cMemoryOwn) {
    super(CLjavaJNI.SWIGSearcherUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  protected static long getCPtr(Searcher obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      CLjavaJNI.delete_Searcher(swigCPtr);
    }
    swigCPtr = 0;
    super.delete();
  }

  public Hits search(Query query) {
    long cPtr = CLjavaJNI.Searcher_search__SWIG_0(swigCPtr, Query.getCPtr(query));
    return (cPtr == 0) ? null : new Hits(cPtr, true);
  }

  public Hits search(Query query, Filter filter) {
    long cPtr = CLjavaJNI.Searcher_search__SWIG_1(swigCPtr, Query.getCPtr(query), Filter.getCPtr(filter));
    return (cPtr == 0) ? null : new Hits(cPtr, true);
  }

  public Hits search(Query query, Sort sort) {
    long cPtr = CLjavaJNI.Searcher_search__SWIG_2(swigCPtr, Query.getCPtr(query), Sort.getCPtr(sort));
    return (cPtr == 0) ? null : new Hits(cPtr, true);
  }

  public Hits search(Query query, Filter filter, Sort sort) {
    long cPtr = CLjavaJNI.Searcher_search__SWIG_3(swigCPtr, Query.getCPtr(query), Filter.getCPtr(filter), Sort.getCPtr(sort));
    return (cPtr == 0) ? null : new Hits(cPtr, true);
  }

  public void setSimilarity(Similarity similarity) {
    CLjavaJNI.Searcher_setSimilarity(swigCPtr, Similarity.getCPtr(similarity));
  }

  public Similarity getSimilarity() {
    long cPtr = CLjavaJNI.Searcher_getSimilarity(swigCPtr);
    return (cPtr == 0) ? null : new Similarity(cPtr, false);
  }

}
