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

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

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

  ~MultiSearcher() {
    Dispose();
  }

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

  public MultiSearcher(Searchable[] searchables) : this(libCLcsharpPINVOKE.new_MultiSearcher(_CL_p_p_lucene__search__SearchableArray.getCPtr(new _CL_p_p_lucene__search__SearchableArray(searchables))), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public int searcherIndex(int n) {
    int ret = libCLcsharpPINVOKE.MultiSearcher_searcherIndex(swigCPtr, n);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int subSearcher(int n) {
    int ret = libCLcsharpPINVOKE.MultiSearcher_subSearcher(swigCPtr, n);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public int subDoc(int n) {
    int ret = libCLcsharpPINVOKE.MultiSearcher_subDoc(swigCPtr, n);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
