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

#ifndef __org_apache_lucene_util_ScorerDocQueue__
#define __org_apache_lucene_util_ScorerDocQueue__

#pragma interface

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

extern "Java"
{
  namespace org
  {
    namespace apache
    {
      namespace lucene
      {
        namespace search
        {
          class Scorer;
        }
        namespace util
        {
          class ScorerDocQueue;
          class ScorerDocQueue$HeapedScorerDoc;
        }
      }
    }
  }
}

class org::apache::lucene::util::ScorerDocQueue : public ::java::lang::Object
{
public:
  ScorerDocQueue (jint);
  void put (::org::apache::lucene::search::Scorer *);
  virtual jboolean insert (::org::apache::lucene::search::Scorer *);
  ::org::apache::lucene::search::Scorer *top ();
  jint topDoc ();
  jfloat topScore ();
  jboolean topNextAndAdjustElsePop ();
  jboolean topSkipToAndAdjustElsePop (jint);
private:
  jboolean checkAdjustElsePop (jboolean);
public:
  ::org::apache::lucene::search::Scorer *pop ();
private:
  void popNoResult ();
public:
  void adjustTop ();
  jint size () { return size__; }
  void clear ();
private:
  void upHeap ();
  void downHeap ();
  JArray< ::org::apache::lucene::util::ScorerDocQueue$HeapedScorerDoc *> * __attribute__((aligned(__alignof__( ::java::lang::Object )))) heap;
  jint maxSize;
  jint size__;
  ::org::apache::lucene::util::ScorerDocQueue$HeapedScorerDoc *topHSD;

  friend class org_apache_lucene_util_ScorerDocQueue$HeapedScorerDoc;
public:

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

#endif /* __org_apache_lucene_util_ScorerDocQueue__ */
