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

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

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

  protected void finalize() {
    delete();
  }

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

  public Term(String fld, String txt) {
    this(CLjavaJNI.new_Term(fld, txt), true);
  }

  public String field() {
    return CLjavaJNI.Term_field(swigCPtr);
  }

  public String text() {
    return CLjavaJNI.Term_text(swigCPtr);
  }

  public int compareTo(Term other) {
    return CLjavaJNI.Term_compareTo(swigCPtr, Term.getCPtr(other));
  }

  public boolean equals(Term other) {
    return CLjavaJNI.Term_equals(swigCPtr, Term.getCPtr(other));
  }

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

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

}
