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

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

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

  ~Field() {
    Dispose();
  }

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

  public Field(string name, string value, bool store, bool index, bool token, bool storeTermVector) : this(libCLcsharpPINVOKE.new_Field__SWIG_0(name, value, store, index, token, storeTermVector), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public Field(string name, string value, bool store, bool index, bool token) : this(libCLcsharpPINVOKE.new_Field__SWIG_1(name, value, store, index, token), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public Field(string name, Reader reader, bool store, bool index, bool token, bool storeTermVector) : this(libCLcsharpPINVOKE.new_Field__SWIG_2(name, Reader.getCPtr(reader), store, index, token, storeTermVector), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public Field(string name, Reader reader, bool store, bool index, bool token) : this(libCLcsharpPINVOKE.new_Field__SWIG_3(name, Reader.getCPtr(reader), store, index, token), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public Field(string name, Reader reader, bool storeTermVector) : this(libCLcsharpPINVOKE.new_Field__SWIG_4(name, Reader.getCPtr(reader), storeTermVector), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public Field(string name, Reader reader) : this(libCLcsharpPINVOKE.new_Field__SWIG_5(name, Reader.getCPtr(reader)), true) {
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public static Field Keyword(string name, string value) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_Keyword(name, value);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field UnIndexed(string name, string value) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_UnIndexed(name, value);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field Text(string name, string value, bool storeTermVector) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_Text__SWIG_0(name, value, storeTermVector);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field Text(string name, string value) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_Text__SWIG_1(name, value);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field UnStored(string name, string value, bool storeTermVector) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_UnStored__SWIG_0(name, value, storeTermVector);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field UnStored(string name, string value) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_UnStored__SWIG_1(name, value);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field Text(string name, Reader value, bool storeTermVector) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_Text__SWIG_2(name, Reader.getCPtr(value), storeTermVector);
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public static Field Text(string name, Reader value) {
    IntPtr cPtr = libCLcsharpPINVOKE.Field_Text__SWIG_3(name, Reader.getCPtr(value));
    Field ret = (cPtr == IntPtr.Zero) ? null : new Field(cPtr, true);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string name() {
    string ret = libCLcsharpPINVOKE.Field_name(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string stringValue() {
    string ret = libCLcsharpPINVOKE.Field_stringValue(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public bool isStored() {
    bool ret = libCLcsharpPINVOKE.Field_isStored(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isIndexed() {
    bool ret = libCLcsharpPINVOKE.Field_isIndexed(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isTokenized() {
    bool ret = libCLcsharpPINVOKE.Field_isTokenized(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool isTermVectorStored() {
    bool ret = libCLcsharpPINVOKE.Field_isTermVectorStored(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public float getBoost() {
    double ret = libCLcsharpPINVOKE.Field_getBoost(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public void setBoost(float value) {
    libCLcsharpPINVOKE.Field_setBoost(swigCPtr, value);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
  }

  public override string ToString() {
    string ret = libCLcsharpPINVOKE.Field_ToString(swigCPtr);
    if (libCLcsharpPINVOKE.SWIGPendingException.Pending) throw libCLcsharpPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
