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

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

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

  protected void finalize() {
    delete();
  }

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

  public static void setDefault(Similarity similarity) {
    CLjavaJNI.Similarity_setDefault(Similarity.getCPtr(similarity));
  }

  public static Similarity getDefault() {
    long cPtr = CLjavaJNI.Similarity_getDefault();
    return (cPtr == 0) ? null : new Similarity(cPtr, false);
  }

  public static byte encodeNorm(float f) {
    return CLjavaJNI.Similarity_encodeNorm(f);
  }

  public static float decodeNorm(byte b) {
    return CLjavaJNI.Similarity_decodeNorm(b);
  }

  public static byte floatToByte(float f) {
    return CLjavaJNI.Similarity_floatToByte(f);
  }

  public static float byteToFloat(byte b) {
    return CLjavaJNI.Similarity_byteToFloat(b);
  }

  public float lengthNorm(String fieldName, int numTokens) {
    return CLjavaJNI.Similarity_lengthNorm(swigCPtr, fieldName, numTokens);
  }

  public float queryNorm(float sumOfSquaredWeights) {
    return CLjavaJNI.Similarity_queryNorm(swigCPtr, sumOfSquaredWeights);
  }

  public float sloppyFreq(int distance) {
    return CLjavaJNI.Similarity_sloppyFreq(swigCPtr, distance);
  }

  public float coord(int overlap, int maxOverlap) {
    return CLjavaJNI.Similarity_coord(swigCPtr, overlap, maxOverlap);
  }

}
