public abstract class AbstractSelectionKey
extends SelectionKey
| java.lang.Object | ||
| ↳ | java.nio.channels.SelectionKey | |
| ↳ | java.nio.channels.spi.AbstractSelectionKey | |
选择键的基本实现类。
这个类跟踪密钥的有效性并实现取消。
Inherited constants |
|---|
java.nio.channels.SelectionKey
|
Protected constructors |
|
|---|---|
AbstractSelectionKey() 初始化此类的新实例。 |
|
Public methods |
|
|---|---|
final void |
cancel() 取消此键。 |
final boolean |
isValid() 告诉这个键是否有效。 |
Inherited methods |
|
|---|---|
java.nio.channels.SelectionKey
|
|
java.lang.Object
|
|
boolean isValid ()
告诉这个键是否有效。
密钥在创建时是有效的,并且一直保持到它被取消,其频道关闭或者其选择器关闭。
| Returns | |
|---|---|
boolean |
true if, and only if, this key is valid |