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

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

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

  protected void finalize() {
    delete();
  }

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

  public static Sort getRELEVANCE() {
    long cPtr = CLjavaJNI.get_Sort_RELEVANCE();
    return (cPtr == 0) ? null : new Sort(cPtr, false);
  }

  public static Sort getINDEXORDER() {
    long cPtr = CLjavaJNI.get_Sort_INDEXORDER();
    return (cPtr == 0) ? null : new Sort(cPtr, false);
  }

  public Sort() {
    this(CLjavaJNI.new_Sort__SWIG_0(), true);
  }

  public Sort(String field, boolean reverse) {
    this(CLjavaJNI.new_Sort__SWIG_1(field, reverse), true);
  }

  public Sort(String field) {
    this(CLjavaJNI.new_Sort__SWIG_2(field), true);
  }

  public Sort(String[] fields) {
    this(CLjavaJNI.new_Sort__SWIG_3(fields), true);
  }

  public Sort(SortField field) {
    this(CLjavaJNI.new_Sort__SWIG_4(SortField.getCPtr(field)), true);
  }

  public Sort(longxx fields) {
    this(CLjavaJNI.new_Sort__SWIG_5(_CL_p_p_lucene__search__SortFieldArray.getCPtr(new _CL_p_p_lucene__search__SortFieldArray(fields))), true);
  }

  public void setSort(String field, boolean reverse) {
    CLjavaJNI.Sort_setSort__SWIG_0(swigCPtr, field, reverse);
  }

  public void setSort(String field) {
    CLjavaJNI.Sort_setSort__SWIG_1(swigCPtr, field);
  }

  public void setSort(String[] fieldnames) {
    CLjavaJNI.Sort_setSort__SWIG_2(swigCPtr, fieldnames);
  }

  public void setSort(SortField field) {
    CLjavaJNI.Sort_setSort__SWIG_3(swigCPtr, SortField.getCPtr(field));
  }

  public void setSort(longxx fields) {
    CLjavaJNI.Sort_setSort__SWIG_4(swigCPtr, _CL_p_p_lucene__search__SortFieldArray.getCPtr(new _CL_p_p_lucene__search__SortFieldArray(fields)));
  }

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

}
