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 Query {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected Query(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

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

  protected void finalize() {
    delete();
  }

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

  public void setBoost(float b) {
    CLjavaJNI.Query_setBoost(swigCPtr, b);
  }

  public float getBoost() {
    return CLjavaJNI.Query_getBoost(swigCPtr);
  }

  public Query rewrite(IndexReader reader) {
    long cPtr = CLjavaJNI.Query_rewrite(swigCPtr, IndexReader.getCPtr(reader));
    return (cPtr == 0) ? null : new Query(cPtr, true);
  }

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

  public Query clone() {
    long cPtr = CLjavaJNI.Query_clone(swigCPtr);
    return (cPtr == 0) ? null : new Query(cPtr, false);
  }

  public String toString(String field) {
    return CLjavaJNI.Query_toString__SWIG_0(swigCPtr, field);
  }

  public boolean equals(Query other) {
    return CLjavaJNI.Query_equals(swigCPtr, Query.getCPtr(other));
  }

  public int hashCode() {
    return CLjavaJNI.Query_hashCode(swigCPtr);
  }

  public String toString() {
    return CLjavaJNI.Query_toString__SWIG_1(swigCPtr);
  }

}
