/* ----------------------------------------------------------------------------
 * 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 TermFreqVector : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~TermFreqVector() {
    Dispose();
  }

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

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

  public virtual int size() {
    int ret = libCLcsharpPINVOKE.TermFreqVector_size(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual string[] getTerms() { return new _CL_p_p_charArray(libCLcsharpPINVOKE.TermFreqVector_getTerms(swigCPtr),true).toArray(); }

  public virtual int[] getTermFrequencies() { return new _CL_p_int32_tArray(libCLcsharpPINVOKE.TermFreqVector_getTermFrequencies(swigCPtr),true).toArray(); }

  public virtual int indexOf(string term) {
    int ret = libCLcsharpPINVOKE.TermFreqVector_indexOf(swigCPtr, term);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
