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

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

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

  ~PrefixQuery() {
    Dispose();
  }

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

  public PrefixQuery(Term Prefix) : this(libCLcsharpPINVOKE.new_PrefixQuery(Term.getCPtr(Prefix)), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

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

}

}
