// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __org_apache_lucene_index_IndexWriter__
#define __org_apache_lucene_index_IndexWriter__

#pragma interface

#include <java/lang/Object.h>
#include <gcj/array.h>

extern "Java"
{
  namespace org
  {
    namespace apache
    {
      namespace lucene
      {
        namespace document
        {
          class Document;
        }
        namespace index
        {
          class IndexWriter;
          class IndexReader;
          class SegmentInfos;
        }
        namespace search
        {
          class Similarity;
        }
        namespace analysis
        {
          class Analyzer;
        }
        namespace store
        {
          class Lock;
          class Directory;
        }
      }
    }
  }
}

class org::apache::lucene::index::IndexWriter : public ::java::lang::Object
{
public:
  virtual jboolean getUseCompoundFile () { return useCompoundFile; }
  virtual void setUseCompoundFile (jboolean);
  virtual void setSimilarity (::org::apache::lucene::search::Similarity *);
  virtual ::org::apache::lucene::search::Similarity *getSimilarity () { return similarity; }
  virtual void setTermIndexInterval (jint);
  virtual jint getTermIndexInterval () { return termIndexInterval; }
  IndexWriter (::java::lang::String *, ::org::apache::lucene::analysis::Analyzer *, jboolean);
  IndexWriter (::java::io::File *, ::org::apache::lucene::analysis::Analyzer *, jboolean);
  IndexWriter (::org::apache::lucene::store::Directory *, ::org::apache::lucene::analysis::Analyzer *, jboolean);
private:
  IndexWriter (::org::apache::lucene::store::Directory *, ::org::apache::lucene::analysis::Analyzer *, jboolean, jboolean);
public:
  virtual void setMaxMergeDocs (jint);
  virtual jint getMaxMergeDocs () { return maxMergeDocs; }
  virtual void setMaxFieldLength (jint);
  virtual jint getMaxFieldLength () { return maxFieldLength; }
  virtual void setMaxBufferedDocs (jint);
  virtual jint getMaxBufferedDocs () { return minMergeDocs; }
  virtual void setMergeFactor (jint);
  virtual jint getMergeFactor () { return mergeFactor; }
  virtual void setInfoStream (::java::io::PrintStream *);
  virtual ::java::io::PrintStream *getInfoStream () { return infoStream; }
  virtual void setCommitLockTimeout (jlong);
  virtual jlong getCommitLockTimeout () { return commitLockTimeout; }
  static void setDefaultCommitLockTimeout (jlong);
  static jlong getDefaultCommitLockTimeout ();
  virtual void setWriteLockTimeout (jlong);
  virtual jlong getWriteLockTimeout () { return writeLockTimeout; }
  static void setDefaultWriteLockTimeout (jlong);
  static jlong getDefaultWriteLockTimeout ();
  virtual void close ();
public:  // actually protected
  virtual void finalize ();
public:
  virtual ::org::apache::lucene::store::Directory *getDirectory () { return directory; }
  virtual ::org::apache::lucene::analysis::Analyzer *getAnalyzer () { return analyzer; }
  virtual jint docCount ();
  virtual void addDocument (::org::apache::lucene::document::Document *);
  virtual void addDocument (::org::apache::lucene::document::Document *, ::org::apache::lucene::analysis::Analyzer *);
public: // actually package-private
  jint getSegmentsCounter ();
private:
  ::java::lang::String *newSegmentName ();
public:
  virtual void optimize ();
  virtual void addIndexes (JArray< ::org::apache::lucene::store::Directory *> *);
  virtual void addIndexes (JArray< ::org::apache::lucene::index::IndexReader *> *);
private:
  void flushRamSegments ();
  void maybeMergeSegments ();
  void mergeSegments (jint);
  void mergeSegments (jint, jint);
  void deleteSegments (::java::util::Vector *);
  void deleteFiles (::java::util::Vector *);
  void deleteFiles (::java::util::Vector *, ::org::apache::lucene::store::Directory *);
  void deleteFiles (::java::util::Vector *, ::java::util::Vector *);
  ::java::util::Vector *readDeleteableFiles ();
  void writeDeleteableFiles (::java::util::Vector *);
public:
  static jlong DEFAULT_WRITE_LOCK_TIMEOUT;
private:
  jlong __attribute__((aligned(__alignof__( ::java::lang::Object ))))  writeLockTimeout;
public:
  static jlong DEFAULT_COMMIT_LOCK_TIMEOUT;
private:
  jlong commitLockTimeout;
public:
  static ::java::lang::String *WRITE_LOCK_NAME;
  static ::java::lang::String *COMMIT_LOCK_NAME;
  static const jint DEFAULT_MERGE_FACTOR = 10L;
  static const jint DEFAULT_MAX_BUFFERED_DOCS = 10L;
  static const jint DEFAULT_MAX_MERGE_DOCS = 2147483647L;
  static const jint DEFAULT_MAX_FIELD_LENGTH = 10000L;
  static const jint DEFAULT_TERM_INDEX_INTERVAL = 128L;
private:
  ::org::apache::lucene::store::Directory *directory;
  ::org::apache::lucene::analysis::Analyzer *analyzer;
  ::org::apache::lucene::search::Similarity *similarity;
  ::org::apache::lucene::index::SegmentInfos *segmentInfos;
  ::org::apache::lucene::store::Directory *ramDirectory;
  jint singleDocSegmentsCount;
  ::org::apache::lucene::store::Lock *writeLock;
  jint termIndexInterval;
  jboolean useCompoundFile;
  jboolean closeDir;
  jint maxFieldLength;
  jint mergeFactor;
  jint minMergeDocs;
  jint maxMergeDocs;
  ::java::io::PrintStream *infoStream;

  friend class org_apache_lucene_index_IndexWriter$1;
  friend class org_apache_lucene_index_IndexWriter$2;
  friend class org_apache_lucene_index_IndexWriter$3;
  friend class org_apache_lucene_index_IndexWriter$4;
  friend class org_apache_lucene_index_IndexWriter$5;
public:

  static ::java::lang::Class class$;
};

#endif /* __org_apache_lucene_index_IndexWriter__ */
