// 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 IndexFileDeleter;
          class SegmentInfos;
        }
        namespace search
        {
          class Similarity;
        }
        namespace analysis
        {
          class Analyzer;
        }
        namespace store
        {
          class Lock;
          class RAMDirectory;
          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 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 getRAMSegmentCount ();
private:
  ::java::lang::String *newRAMSegmentName ();
public: // actually package-private
  jint getSegmentCount ();
  jint getDocCount (jint);
private:
  ::java::lang::String *newSegmentName ();
public:
  virtual void optimize ();
  virtual void addIndexes (JArray< ::org::apache::lucene::store::Directory *> *);
  virtual void addIndexesNoOptimize (JArray< ::org::apache::lucene::store::Directory *> *);
  virtual void addIndexes (JArray< ::org::apache::lucene::index::IndexReader *> *);
private:
  void maybeFlushRamSegments ();
public:
  void flushRamSegments ();
  jlong ramSizeInBytes ();
  jint numRamDocs ();
private:
  void maybeMergeSegments (jint);
  jint mergeSegments (::org::apache::lucene::index::SegmentInfos *, jint, jint);
  jboolean checkNonDecreasingLevels (jint);
public:
  static jlong DEFAULT_WRITE_LOCK_TIMEOUT;
private:
  jlong __attribute__((aligned(__alignof__( ::java::lang::Object ))))  writeLockTimeout;
public:
  static ::java::lang::String *WRITE_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::index::SegmentInfos *ramSegmentInfos;
  ::org::apache::lucene::store::RAMDirectory *ramDirectory;
  ::org::apache::lucene::index::IndexFileDeleter *deleter;
  ::org::apache::lucene::store::Lock *writeLock;
  jint termIndexInterval;
  jboolean useCompoundFile;
  jboolean closeDir;
  jint maxFieldLength;
  jint mergeFactor;
  jint minMergeDocs;
  jint maxMergeDocs;
  ::java::io::PrintStream *infoStream;
public:

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

#endif /* __org_apache_lucene_index_IndexWriter__ */
