|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectseda.nbio.SelectItem
A SelectItem represents a single socket/file descriptor/etc. which can be handled by a SelectSet. Each SelectItem has an associated Selectable as well as two event masks: 'events' and 'revents'. Setting 'events' allows you to specify which events you are interested in receiving notification on for this Selectable. After calling SelectSet.select(), 'revents' will be set to the set of events that occurred.
Field Summary | |
short |
events
The set of events that you are interested in receiving notification on. |
java.lang.Object |
obj
A state object associated with this SelectItem. |
short |
revents
The set of events that occurred. |
Constructor Summary | |
SelectItem(Selectable sel,
java.lang.Object obj,
short events)
Create a SelectItem with the given Selectable, given state pointer, and the given event mask. |
|
SelectItem(Selectable sel,
short events)
Create a SelectItem with the given Selectable and the given event mask. |
Method Summary | |
short |
getEvents()
Return the requested events mask. |
(package private) NBIOFileDescriptor |
getFD()
|
java.lang.Object |
getObj()
Return the state pointer associated with this SelectItem. |
Selectable |
getSelectable()
Return the Selectable associated with this SelectItem. |
short |
returnedEvents()
Return the returned events mask. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public short events
Important: If you change the events field of a SelectItem after registering it with a SelectSet (using SelectSet.add()), you must invoke SelectSet.update() to push the new event mask to the SelectSet.
Selectable
,
SelectSet
public short revents
Selectable
public java.lang.Object obj
Constructor Detail |
public SelectItem(Selectable sel, java.lang.Object obj, short events)
public SelectItem(Selectable sel, short events)
Method Detail |
NBIOFileDescriptor getFD()
public Selectable getSelectable()
public java.lang.Object getObj()
public short getEvents()
public short returnedEvents()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |