JavaTM 2 Platform
Standard Ed. 6

类 java.nio.channels.SelectionKey
的使用

使用 SelectionKey 的软件包
java.nio.channels 定义了各种通道,这些通道表示到能够执行 I/O 操作的实体(如文件和套接字)的连接;定义了用于多路复用的、非阻塞 I/O 操作的选择器。 
java.nio.channels.spi 用于 java.nio.channels 包的服务提供者类。 
 

java.nio.channelsSelectionKey 的使用
 

返回 SelectionKeyjava.nio.channels 中的方法
abstract  SelectionKey SelectionKey.interestOps(int ops)
          将此键的 interest 集合设置为给定值。
abstract  SelectionKey SelectableChannel.keyFor(Selector sel)
          获取表示通道向给定选择器注册的键。
 SelectionKey SelectableChannel.register(Selector sel, int ops)
          向给定的选择器注册此通道,返回一个选择键。
abstract  SelectionKey SelectableChannel.register(Selector sel, int ops, Object att)
          向给定的选择器注册此通道,返回一个选择键。
 

返回变量类型为 SelectionKey 的类型的 java.nio.channels 中的方法
abstract  Set<SelectionKey> Selector.keys()
          返回此选择器的键集。
abstract  Set<SelectionKey> Selector.selectedKeys()
          返回此选择器的已选择键集。
 

java.nio.channels.spiSelectionKey 的使用
 

java.nio.channels.spiSelectionKey 的子类
 class AbstractSelectionKey
          选择键的基本实现类。
 

返回 SelectionKeyjava.nio.channels.spi 中的方法
 SelectionKey AbstractSelectableChannel.keyFor(Selector sel)
           
protected abstract  SelectionKey AbstractSelector.register(AbstractSelectableChannel ch, int ops, Object att)
          向此选择器注册给定的通道。
 SelectionKey AbstractSelectableChannel.register(Selector sel, int ops, Object att)
          向给定的选择器注册此通道,返回一个选择键。
 

返回变量类型为 SelectionKey 的类型的 java.nio.channels.spi 中的方法
protected  Set<SelectionKey> AbstractSelector.cancelledKeys()
          获取此选择器的已取消键集。
 


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only