API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.nio.channels. SelectionKey View Source
Author(s)
Mark Reinhold
JSR-51 Expert Group
Since
1.4
Version
1.26, 06/06/28
Serial
Hierarchy
 Object
      SelectionKey
Implements
Subclasses
Description
publicabstract abstract class SelectionKey
  A token representing the registration of a SelectableChannel with a Selector.
See also:    SelectableChannel Selector
Constructors
protected SelectionKey ()
Constructs an instance of this class.
Methods
Hide/Show inherited methods
publicfinal Object attach (Object ob)
  Attaches the given object to this key.
publicfinal Object attachment ()
  Retrieves the current attachment.
publicabstract void cancel ()
  Requests that the registration of this key's channel with its selector be cancelled.
publicabstract SelectableChannel channel ()
  Returns the channel for which this key was created.
publicabstract int interestOps ()
  Retrieves this key's interest set.
publicabstract SelectionKey interestOps (int ops)
  Sets this key's interest set to the given value.
publicfinal boolean isAcceptable ()
  Tests whether this key's channel is ready to accept a new socket connection.
publicfinal boolean isConnectable ()
  Tests whether this key's channel has either finished, or failed to finish, its socket-connection operation.
publicfinal boolean isReadable ()
  Tests whether this key's channel is ready for reading.
publicabstract boolean isValid ()
  Tells whether or not this key is valid.
publicfinal boolean isWritable ()
  Tests whether this key's channel is ready for writing.
publicabstract int readyOps ()
  Retrieves this key's ready-operation set.
publicabstract Selector selector ()
  Returns the selector for which this key was created.
Fields
Hide/Show inherited fields
publicfinalstatic int OP_ACCEPT = "16"
  Operation-set bit for socket-accept operations.
publicfinalstatic int OP_CONNECT = "8"
  Operation-set bit for socket-connect operations.
publicfinalstatic int OP_READ = "1"
  Operation-set bit for read operations.
publicfinalstatic int OP_WRITE = "4"
  Operation-set bit for write operations.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar