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

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

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

  ~BooleanQuery() {
    Dispose();
  }

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

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

  public static int getMaxClauseCount() {
    int ret = libCLcsharpPINVOKE.BooleanQuery_getMaxClauseCount();
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static void setMaxClauseCount(int maxClauseCount) {
    libCLcsharpPINVOKE.BooleanQuery_setMaxClauseCount(maxClauseCount);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public void add(Query query, bool required, bool prohibited) {
    libCLcsharpPINVOKE.BooleanQuery_add(swigCPtr, Query.getCPtr(query), required, prohibited);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

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

}

}
