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

#ifndef __gnu_java_nio_SelectorImpl__
#define __gnu_java_nio_SelectorImpl__

#pragma interface

#include <java/nio/channels/spi/AbstractSelector.h>
#include <gcj/array.h>

extern "Java"
{
  namespace gnu
  {
    namespace java
    {
      namespace nio
      {
        class SelectorImpl;
        class SelectionKeyImpl;
      }
    }
  }
  namespace java
  {
    namespace nio
    {
      namespace channels
      {
        class SelectionKey;
        class SelectableChannel;
        class Selector;
        namespace spi
        {
          class AbstractSelectableChannel;
          class SelectorProvider;
        }
      }
    }
  }
};

class ::gnu::java::nio::SelectorImpl : public ::java::nio::channels::spi::AbstractSelector
{
public:
  SelectorImpl (::java::nio::channels::spi::SelectorProvider *);
  virtual ::java::util::Set *keys () { return keys__; }
  virtual jint selectNow ();
  virtual jint select ();
private:
  static jint java_do_select (jintArray, jintArray, jintArray, jlong);
  jintArray getFDsAsArray (jint);
public:
  virtual jint select (jlong);
  virtual ::java::util::Set *selectedKeys () { return selected; }
  virtual ::java::nio::channels::Selector *wakeup () { return 0; }
  virtual void add (::gnu::java::nio::SelectionKeyImpl *);
public: // actually package-private
  virtual void add_selected (::gnu::java::nio::SelectionKeyImpl *);
public:  // actually protected
  virtual void implCloseSelector ();
private:
  void deregisterCanceledKeys ();
public:  // actually protected
  virtual ::java::nio::channels::SelectionKey *register$ (::java::nio::channels::SelectableChannel *, jint, ::java::lang::Object *);
  virtual ::java::nio::channels::SelectionKey *register$ (::java::nio::channels::spi::AbstractSelectableChannel *, jint, ::java::lang::Object *);
public: // actually package-private
  jboolean __attribute__((aligned(__alignof__( ::java::nio::channels::spi::AbstractSelector ))))  closed;
  ::java::util::Set *keys__;
  ::java::util::Set *selected;
  ::java::util::Set *canceled;
public:

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

#endif /* __gnu_java_nio_SelectorImpl__ */
