FileDocCategorySizeDatePackage
AbstractSelectionKey.javaAPI DocAndroid 1.5 API2098Wed May 06 22:41:04 BST 2009java.nio.channels.spi

AbstractSelectionKey

public abstract class AbstractSelectionKey extends SelectionKey
{@code AbstractSelectionKey} is the base implementation class for selection keys. It implements validation and cancellation methods.
since
Android 1.0

Fields Summary
boolean
isValid
Constructors Summary
protected AbstractSelectionKey()
Constructs a new {@code AbstractSelectionKey}.

since
Android 1.0


                  
      
        super();
    
Methods Summary
public final voidcancel()
Cancels this key.

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

since
Android 1.0

        if (isValid) {
            isValid = false;
            ((AbstractSelector) selector()).cancel(this);
        }
    
public final booleanisValid()
Indicates whether this key is valid. A key is valid as long as it has not been canceled.

return
{@code true} if this key has not been canceled, {@code false} otherwise.
since
Android 1.0

        return isValid;