package clucene;
/* ----------------------------------------------------------------------------
 * 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.
 * ----------------------------------------------------------------------------- */


public class IndexWriter {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected IndexWriter(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(IndexWriter obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public void delete() {
    if(swigCPtr != 0 && swigCMemOwn) {
      swigCMemOwn = false;
      CLjavaJNI.delete_IndexWriter(swigCPtr);
    }
    swigCPtr = 0;
  }

  public int getMaxFieldLength() {
    return CLjavaJNI.IndexWriter_getMaxFieldLength(swigCPtr);
  }

  public void setMaxFieldLength(int val) {
    CLjavaJNI.IndexWriter_setMaxFieldLength(swigCPtr, val);
  }

  public int getMergeFactor() {
    return CLjavaJNI.IndexWriter_getMergeFactor(swigCPtr);
  }

  public void setMergeFactor(int val) {
    CLjavaJNI.IndexWriter_setMergeFactor(swigCPtr, val);
  }

  public int getMinMergeDocs() {
    return CLjavaJNI.IndexWriter_getMinMergeDocs(swigCPtr);
  }

  public void setMinMergeDocs(int val) {
    CLjavaJNI.IndexWriter_setMinMergeDocs(swigCPtr, val);
  }

  public int getMaxMergeDocs() {
    return CLjavaJNI.IndexWriter_getMaxMergeDocs(swigCPtr);
  }

  public void setMaxMergeDocs(int val) {
    CLjavaJNI.IndexWriter_setMaxMergeDocs(swigCPtr, val);
  }

  public IndexWriter(String path, Analyzer a, boolean create, boolean closeDir) {
    this(CLjavaJNI.new_IndexWriter__SWIG_0(path, Analyzer.getCPtr(a), create, closeDir), true);
  }

  public IndexWriter(String path, Analyzer a, boolean create) {
    this(CLjavaJNI.new_IndexWriter__SWIG_1(path, Analyzer.getCPtr(a), create), true);
  }

  public IndexWriter(Directory d, Analyzer a, boolean create, boolean closeDir) {
    this(CLjavaJNI.new_IndexWriter__SWIG_2(Directory.getCPtr(d), Analyzer.getCPtr(a), create, closeDir), true);
  }

  public IndexWriter(Directory d, Analyzer a, boolean create) {
    this(CLjavaJNI.new_IndexWriter__SWIG_3(Directory.getCPtr(d), Analyzer.getCPtr(a), create), true);
  }

  public void close() {
    CLjavaJNI.IndexWriter_close(swigCPtr);
  }

  public int docCount() {
    return CLjavaJNI.IndexWriter_docCount(swigCPtr);
  }

  public void addDocument(Document doc) {
    CLjavaJNI.IndexWriter_addDocument(swigCPtr, Document.getCPtr(doc));
  }

  public void optimize() {
    CLjavaJNI.IndexWriter_optimize(swigCPtr);
  }

  public Directory getDirectory() {
    long cPtr = CLjavaJNI.IndexWriter_getDirectory(swigCPtr);
    return (cPtr == 0) ? null : new Directory(cPtr, false);
  }

  public boolean getUseCompoundFile() {
    return CLjavaJNI.IndexWriter_getUseCompoundFile(swigCPtr);
  }

  public void setUseCompoundFile(boolean value) {
    CLjavaJNI.IndexWriter_setUseCompoundFile(swigCPtr, value);
  }

  public void setSimilarity(Similarity similarity) {
    CLjavaJNI.IndexWriter_setSimilarity(swigCPtr, Similarity.getCPtr(similarity));
  }

  public Similarity getSimilarity() {
    long cPtr = CLjavaJNI.IndexWriter_getSimilarity(swigCPtr);
    return (cPtr == 0) ? null : new Similarity(cPtr, false);
  }

  public Analyzer getAnalyzer() {
    long cPtr = CLjavaJNI.IndexWriter_getAnalyzer(swigCPtr);
    return (cPtr == 0) ? null : new Analyzer(cPtr, false);
  }

}
