|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.nio.channels.SelectionKey
public abstract class SelectionKey
A key that representing the relationship of a channel and the selector.
| Field Summary | |
|---|---|
static int |
OP_ACCEPT
Interesting operation mask bit for socket-accept operations. |
static int |
OP_CONNECT
Interesting operation mask bit for socket-connect operations. |
static int |
OP_READ
Interesting operation mask bit for read operations. |
static int |
OP_WRITE
Interesting operation mask bit for write operations. |
| Constructor Summary | |
|---|---|
protected |
SelectionKey()
The constructor. |
| Method Summary | |
|---|---|
Object |
attach(Object anObject)
Attaches an object to the key. |
Object |
attachment()
Gets the attached object. |
abstract void |
cancel()
Cancels this key. |
abstract SelectableChannel |
channel()
Gets the channel of this key. |
abstract int |
interestOps()
Gets the interesting operation of this key. |
abstract SelectionKey |
interestOps(int operations)
Sets the interesting operation for this key. |
boolean |
isAcceptable()
Tells whether the channel of this key is interested in accept operation and ready for acceptation. |
boolean |
isConnectable()
Tells whether the channel of this key is interested in connect operation and ready for connection. |
boolean |
isReadable()
Tells whether the channel of this key is interested in read operation and ready for reading. |
abstract boolean |
isValid()
Tells whether the key is valid. |
boolean |
isWritable()
Tells whether the channel of this key is interested in write operation and ready for writing. |
abstract int |
readyOps()
Gets the ready operation. |
abstract Selector |
selector()
Gets the related selector. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OP_ACCEPT
public static final int OP_CONNECT
public static final int OP_READ
public static final int OP_WRITE
| Constructor Detail |
|---|
protected SelectionKey()
| Method Detail |
|---|
public final Object attach(Object anObject)
anObject - the object to attach
public final Object attachment()
public abstract void cancel()
public abstract SelectableChannel channel()
public abstract int interestOps()
CancelledKeyException - If the key has been cancelled alreadypublic abstract SelectionKey interestOps(int operations)
operations - the interesting operation to set
IllegalArgumentException - if the given operation is not in the key's interesting
operation set
CancelledKeyException - If the key has been cancelled alreadypublic final boolean isAcceptable()
CancelledKeyException - If the key has been cancelled alreadypublic final boolean isConnectable()
CancelledKeyException - If the key has been cancelled alreadypublic final boolean isReadable()
CancelledKeyException - If the key has been cancelled alreadypublic abstract boolean isValid()
public final boolean isWritable()
CancelledKeyException - If the key has been cancelled alreadypublic abstract int readyOps()
CancelledKeyException - If the key has been cancelled alreadypublic abstract Selector selector()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||