/* ----------------------------------------------------------------------------
 * 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.
 * ----------------------------------------------------------------------------- */

namespace clucene.net {

using System;
using System.Runtime.InteropServices;

public class SortField : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal SortField(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(SortField obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~SortField() {
    Dispose();
  }

  public virtual void Dispose() {
    if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
      swigCMemOwn = false;
      libCLcsharpPINVOKE.delete_SortField(swigCPtr);
    }
    swigCPtr = new HandleRef(null, IntPtr.Zero);
    GC.SuppressFinalize(this);
  }

  public static SortField FIELD_SCORE {
    get {
      IntPtr cPtr = libCLcsharpPINVOKE.get_SortField_FIELD_SCORE();
      SortField ret = (cPtr == IntPtr.Zero) ? null : new SortField(cPtr, false);
      if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public static SortField FIELD_DOC {
    get {
      IntPtr cPtr = libCLcsharpPINVOKE.get_SortField_FIELD_DOC();
      SortField ret = (cPtr == IntPtr.Zero) ? null : new SortField(cPtr, false);
      if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public SortField(string field) : this(libCLcsharpPINVOKE.new_SortField__SWIG_0(field), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public SortField(string field, bool reverse) : this(libCLcsharpPINVOKE.new_SortField__SWIG_1(field, reverse), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public SortField(string field, int type, bool reverse) : this(libCLcsharpPINVOKE.new_SortField__SWIG_2(field, type, reverse), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public string getField() {
    string ret = libCLcsharpPINVOKE.SortField_getField(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int getType() {
    int ret = libCLcsharpPINVOKE.SortField_getType(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool getReverse() {
    bool ret = libCLcsharpPINVOKE.SortField_getReverse(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override string ToString() {
    string ret = libCLcsharpPINVOKE.SortField_ToString(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static readonly int SCORE = libCLcsharpPINVOKE.get_SortField_SCORE();
  public static readonly int DOC = libCLcsharpPINVOKE.get_SortField_DOC();
  public static readonly int AUTO = libCLcsharpPINVOKE.get_SortField_AUTO();
  public static readonly int STRING = libCLcsharpPINVOKE.get_SortField_STRING();
  public static readonly int INT = libCLcsharpPINVOKE.get_SortField_INT();
  public static readonly int FLOAT = libCLcsharpPINVOKE.get_SortField_FLOAT();
  public static readonly int CUSTOM = libCLcsharpPINVOKE.get_SortField_CUSTOM();
}

}
