to top
Android APIs
public abstract class

AbstractSelectionKey

extends SelectionKey
java.lang.Object
   ↳ java.nio.channels.SelectionKey
     ↳ java.nio.channels.spi.AbstractSelectionKey

Class Overview

AbstractSelectionKey is the base implementation class for selection keys. It implements validation and cancellation methods.

Summary

[Expand]
Inherited Constants
From class java.nio.channels.SelectionKey
Protected Constructors
AbstractSelectionKey()
Constructs a new AbstractSelectionKey.
Public Methods
final void cancel()
Cancels this key.
final boolean isValid()
Indicates whether this key is valid.
[Expand]
Inherited Methods
From class java.nio.channels.SelectionKey
From class java.lang.Object

Protected Constructors

protected AbstractSelectionKey ()

Added in API level 1

Constructs a new AbstractSelectionKey.

Public Methods

public final void cancel ()

Added in API level 1

Cancels this key.

A key that has been canceled is no longer valid. Calling this method on an already canceled key does nothing.

public final boolean isValid ()

Added in API level 1

Indicates whether this key is valid. A key is valid as long as it has not been canceled.

Returns
  • true if this key has not been canceled, false otherwise.