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

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

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

  ~DateFilter() {
    Dispose();
  }

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

  public DateFilter(string f, long from, long to) : this(libCLcsharpPINVOKE.new_DateFilter(f, from, to), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public static DateFilter Before(string field, long time) {
    IntPtr cPtr = libCLcsharpPINVOKE.DateFilter_Before(field, time);
    DateFilter ret = (cPtr == IntPtr.Zero) ? null : new DateFilter(cPtr, false);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static DateFilter After(string field, long time) {
    IntPtr cPtr = libCLcsharpPINVOKE.DateFilter_After(field, time);
    DateFilter ret = (cPtr == IntPtr.Zero) ? null : new DateFilter(cPtr, false);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
