Class Overview
AbstractSelectionKey
is the base implementation class for selection keys.
It implements validation and cancellation methods.
Summary
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
final
Object
|
attach(Object anObject)
Attaches an object to this key.
|
final
Object
|
attachment()
Gets the attached object.
|
abstract
void
|
cancel()
Cancels this key.
|
abstract
SelectableChannel
|
channel()
Gets the channel of this key.
|
abstract
int
|
interestOps()
|
abstract
SelectionKey
|
interestOps(int operations)
|
final
boolean
|
isAcceptable()
Indicates whether this key's channel is interested in the accept
operation and is ready to accept new connections.
|
final
boolean
|
isConnectable()
Indicates whether this key's channel is interested in the connect
operation and is ready to connect.
|
final
boolean
|
isReadable()
Indicates whether this key's channel is interested in the read operation
and is ready to read.
|
abstract
boolean
|
isValid()
Indicates whether this key is valid.
|
final
boolean
|
isWritable()
Indicates whether this key's channel is interested in the write operation
and is ready to write.
|
abstract
int
|
readyOps()
Gets the set of operations that are ready.
|
abstract
Selector
|
selector()
Gets the selector for which this key's channel is registered.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Protected Constructors
protected
AbstractSelectionKey
()
Constructs a new AbstractSelectionKey
.
Public Methods
public
final
void
cancel
()
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
()
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.