FileDocCategorySizeDatePackage
AbstractSelectionKey.javaAPI DocJava SE 5 API1189Fri Aug 26 14:57:10 BST 2005java.nio.channels.spi

AbstractSelectionKey

public abstract class AbstractSelectionKey extends SelectionKey
Base implementation class for selection keys.

This class tracks the validity of the key and implements cancellation.

author
Mark Reinhold
author
JSR-51 Expert Group
version
1.11, 03/12/19
since
1.4

Fields Summary
private volatile boolean
valid
Constructors Summary
protected AbstractSelectionKey()
Initializes a new instance of this class.

 
Methods Summary
public final voidcancel()
Cancels this key.

If this key has not yet been cancelled then it is added to its selector's cancelled-key set while synchronized on that set.

	if (valid) {
            valid = false;
            ((AbstractSelector)selector()).cancel(this);
        }
    
voidinvalidate()

					// package-private
	valid = false;
    
public final booleanisValid()


        
	return valid;