This class tracks the validity of the key and implements cancellation.
Initializes a new instance of this class.
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); }
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); }
// package-private valid = false;
return valid;