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

#ifndef __org_apache_lucene_index_SegmentMerger__
#define __org_apache_lucene_index_SegmentMerger__

#pragma interface

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

extern "Java"
{
  namespace org
  {
    namespace apache
    {
      namespace lucene
      {
        namespace index
        {
          class SegmentMerger;
          class SegmentMergeInfo;
          class IndexReader;
          class IndexWriter;
          class TermInfo;
          class SegmentMergeQueue;
          class TermInfosWriter;
          class FieldInfos;
        }
        namespace store
        {
          class RAMOutputStream;
          class IndexOutput;
          class Directory;
        }
      }
    }
  }
}

class org::apache::lucene::index::SegmentMerger : public ::java::lang::Object
{
public: // actually package-private
  SegmentMerger (::org::apache::lucene::store::Directory *, ::java::lang::String *);
  SegmentMerger (::org::apache::lucene::index::IndexWriter *, ::java::lang::String *);
  void add (::org::apache::lucene::index::IndexReader *);
  ::org::apache::lucene::index::IndexReader *segmentReader (jint);
  jint merge ();
  void closeReaders ();
  ::java::util::Vector *createCompoundFile (::java::lang::String *);
private:
  void addIndexed (::org::apache::lucene::index::IndexReader *, ::org::apache::lucene::index::FieldInfos *, ::java::util::Collection *, jboolean, jboolean, jboolean);
  jint mergeFields ();
  void mergeVectors ();
  void mergeTerms ();
  void mergeTermInfos ();
  void mergeTermInfo (JArray< ::org::apache::lucene::index::SegmentMergeInfo *> *, jint);
  jint appendPostings (JArray< ::org::apache::lucene::index::SegmentMergeInfo *> *, jint);
  void resetSkip ();
  void bufferSkip (jint);
  jlong writeSkip ();
  void mergeNorms ();
  ::org::apache::lucene::store::Directory * __attribute__((aligned(__alignof__( ::java::lang::Object )))) directory;
  ::java::lang::String *segment;
  jint termIndexInterval;
  ::java::util::Vector *readers;
  ::org::apache::lucene::index::FieldInfos *fieldInfos;
  ::org::apache::lucene::store::IndexOutput *freqOutput;
  ::org::apache::lucene::store::IndexOutput *proxOutput;
  ::org::apache::lucene::index::TermInfosWriter *termInfosWriter;
  jint skipInterval;
  ::org::apache::lucene::index::SegmentMergeQueue *queue;
  ::org::apache::lucene::index::TermInfo *termInfo;
  ::org::apache::lucene::store::RAMOutputStream *skipBuffer;
  jint lastSkipDoc;
  jlong lastSkipFreqPointer;
  jlong lastSkipProxPointer;

  friend class org_apache_lucene_index_SegmentMerger$1;
  friend class org_apache_lucene_index_IndexReader$FieldOption;
public:

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

#endif /* __org_apache_lucene_index_SegmentMerger__ */
