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

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

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

  ~PhraseQuery() {
    Dispose();
  }

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

  public PhraseQuery() : this(libCLcsharpPINVOKE.new_PhraseQuery(), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public void setSlop(int s) {
    libCLcsharpPINVOKE.PhraseQuery_setSlop(swigCPtr, s);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

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

  public void add(Term term) {
    libCLcsharpPINVOKE.PhraseQuery_add__SWIG_0(swigCPtr, Term.getCPtr(term));
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public void add(Term term, int position) {
    libCLcsharpPINVOKE.PhraseQuery_add__SWIG_1(swigCPtr, Term.getCPtr(term), position);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
