GeezerVison is showing docs.oracle.com — SelectionKey (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.nio.channels
Class SelectionKey
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
static int |
OP_ACCEPT |
Operation-set bit for socket-accept operations.
|
static int |
OP_CONNECT |
Operation-set bit for socket-connect operations.
|
static int |
OP_READ |
Operation-set bit for read operations.
|
static int |
OP_WRITE |
Operation-set bit for write operations.
|
-
Constructor Summary
Constructors
| Modifier |
Constructor |
Description |
protected |
SelectionKey() |
Constructs an instance of this class.
|
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
| Modifier and Type |
Method |
Description |
Object |
attach(Object ob) |
Attaches the given object to this key.
|
Object |
attachment() |
Retrieves the current attachment.
|
abstract void |
cancel() |
Requests that the registration of this key's channel with its selector
be cancelled.
|
abstract SelectableChannel |
channel() |
Returns the channel for which this key was created.
|
abstract int |
interestOps() |
Retrieves this key's interest set.
|
abstract SelectionKey |
interestOps(int ops) |
Sets this key's interest set to the given value.
|
boolean |
isAcceptable() |
Tests whether this key's channel is ready to accept a new socket
connection.
|
boolean |
isConnectable() |
Tests whether this key's channel has either finished, or failed to
finish, its socket-connection operation.
|
boolean |
isReadable() |
Tests whether this key's channel is ready for reading.
|
abstract boolean |
isValid() |
Tells whether or not this key is valid.
|
boolean |
isWritable() |
Tests whether this key's channel is ready for writing.
|
abstract int |
readyOps() |
Retrieves this key's ready-operation set.
|
abstract Selector |
selector() |
Returns the selector for which this key was created.
|
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|