More information: http://www.cs.berkeley.edu/~mdw/proj/seda/

seda.nbio
Class SelectItem

java.lang.Object
  |
  +--seda.nbio.SelectItem

public class SelectItem
extends java.lang.Object

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

events

public short events
The set of events that you are interested in receiving notification on. The event types are specified by the constants in Selectable.

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.

See Also:
Selectable, SelectSet

revents

public short revents
The set of events that occurred. The event types are specified by the constants in Selectable.
See Also:
Selectable

obj

public java.lang.Object obj
A state object associated with this SelectItem. You can use this for any purpose you like.
Constructor Detail

SelectItem

public 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

public SelectItem(Selectable sel,
                  short events)
Create a SelectItem with the given Selectable and the given event mask.
Method Detail

getFD

NBIOFileDescriptor getFD()

getSelectable

public Selectable getSelectable()
Return the Selectable associated with this SelectItem.

getObj

public java.lang.Object getObj()
Return the state pointer associated with this SelectItem.

getEvents

public short getEvents()
Return the requested events mask.

returnedEvents

public short returnedEvents()
Return the returned events mask.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

More information: http://www.cs.berkeley.edu/~mdw/proj/seda/