/* ----------------------------------------------------------------------------
 * 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 RangeQuery : Query {
  private HandleRef swigCPtr;

  internal RangeQuery(IntPtr cPtr, bool cMemoryOwn) : base(libCLcsharpPINVOKE.RangeQueryUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~RangeQuery() {
    Dispose();
  }

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

  public RangeQuery(Term LowerTerm, Term UpperTerm, bool Inclusive) : this(libCLcsharpPINVOKE.new_RangeQuery(Term.getCPtr(LowerTerm), Term.getCPtr(UpperTerm), Inclusive), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public Term getLowerTerm() {
    IntPtr cPtr = libCLcsharpPINVOKE.RangeQuery_getLowerTerm(swigCPtr);
    Term ret = (cPtr == IntPtr.Zero) ? null : new Term(cPtr, false);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Term getUpperTerm() {
    IntPtr cPtr = libCLcsharpPINVOKE.RangeQuery_getUpperTerm(swigCPtr);
    Term ret = (cPtr == IntPtr.Zero) ? null : new Term(cPtr, false);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

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

}

}
