Public Member Functions | |
String | toString () |
Package Functions | |
SelectSetPollImpl () | |
Create a SelectSetPollImpl with no SelectItems. | |
synchronized void | add (SelectItem sel) |
Add a SelectItem to this SelectSetPollImpl. | |
synchronized void | add (SelectItem selarr[]) |
Add all of the SelectItems in the given array to the SelectSetPollImpl. | |
synchronized void | remove (SelectItem sel) |
Remove a SelectItem from the SelectSetPollImpl. | |
synchronized void | remove (SelectItem selarr[]) |
Remove all of the SelectItems in the given array from the SelectSetPollImpl. | |
synchronized void | remove (int index) |
Remove the SelectItem at the given index from the SelectSetPollImpl. | |
void | update () |
Update any changed event masks in the SelectSet. | |
void | update (SelectItem sel) |
Update any changed event masks in this SelectItem. | |
synchronized int | size () |
Return the number of SelectItems in this SelectSetPollImpl. | |
synchronized int | numActive () |
Return the number of active SelectItems in this SelectSetPollImpl. | |
synchronized SelectItem | elementAt (int index) |
Return the SelectItem at the given index. | |
int | select (int timeout) |
Wait for events to occur on the SelectItems in this SelectSetPollImpl. | |
synchronized SelectItem[] | getEvents (short mask) |
Returns an array of SelectItems for which events matching the given event mask have occurred (that is, that the revents field matches the given mask). | |
synchronized SelectItem[] | getEvents () |
Returns an array of SelectItems for which some events have occurred (that is, that the revents field is nonzero). | |
Static Package Functions | |
static boolean | isSupported () |
Returns true if poll(2) is supported on this platform. | |
Private Member Functions | |
native int | doSelect (int timeout) |
void | itemarrupdate () |
Private Attributes | |
Vector | vec |
SelectItem | itemarr [] |
boolean | needUpdate = false |
int | cachedActiveCount = -1 |
seda.nbio.SelectSetPollImpl.SelectSetPollImpl | ( | ) | [package] |
Create a SelectSetPollImpl with no SelectItems.
native int seda.nbio.SelectSetPollImpl.doSelect | ( | int | timeout | ) | [private] |
void seda.nbio.SelectSetPollImpl.itemarrupdate | ( | ) | [private] |
static boolean seda.nbio.SelectSetPollImpl.isSupported | ( | ) | [static, package] |
Returns true if poll(2) is supported on this platform.
synchronized void seda.nbio.SelectSetPollImpl.add | ( | SelectItem | sel | ) | [package, virtual] |
synchronized void seda.nbio.SelectSetPollImpl.add | ( | SelectItem | selarr[] | ) | [package, virtual] |
Add all of the SelectItems in the given array to the SelectSetPollImpl.
Implements seda.nbio.SelectSetImpl.
synchronized void seda.nbio.SelectSetPollImpl.remove | ( | SelectItem | sel | ) | [package, virtual] |
synchronized void seda.nbio.SelectSetPollImpl.remove | ( | SelectItem | selarr[] | ) | [package, virtual] |
Remove all of the SelectItems in the given array from the SelectSetPollImpl.
Implements seda.nbio.SelectSetImpl.
synchronized void seda.nbio.SelectSetPollImpl.remove | ( | int | index | ) | [package, virtual] |
Remove the SelectItem at the given index from the SelectSetPollImpl.
Implements seda.nbio.SelectSetImpl.
void seda.nbio.SelectSetPollImpl.update | ( | ) | [package, virtual] |
Update any changed event masks in the SelectSet.
Does nothing in this implementation.
Implements seda.nbio.SelectSetImpl.
void seda.nbio.SelectSetPollImpl.update | ( | SelectItem | sel | ) | [package, virtual] |
Update any changed event masks in this SelectItem.
Does nothing in this implementation.
Implements seda.nbio.SelectSetImpl.
synchronized int seda.nbio.SelectSetPollImpl.size | ( | ) | [package, virtual] |
synchronized int seda.nbio.SelectSetPollImpl.numActive | ( | ) | [package, virtual] |
Return the number of active SelectItems in this SelectSetPollImpl.
Implements seda.nbio.SelectSetImpl.
synchronized SelectItem seda.nbio.SelectSetPollImpl.elementAt | ( | int | index | ) | [package, virtual] |
int seda.nbio.SelectSetPollImpl.select | ( | int | timeout | ) | [package, virtual] |
Wait for events to occur on the SelectItems in this SelectSetPollImpl.
Upon return, the 'revents' field of each SelectItem will be set to the mask of events that occurred. Note that this method does not set revents to 0 when called; after processing an event, it is the application's responsibility to clear the revents field. This is intentional: if the application wishes to delay the processing of an event, it can leave the revents field as-is so that subsequent calls to select will continue to indicate that the event is pending.
IMPORTANT NOTE: If timeout is non-zero, this call will block the thread which invokes it. If you are using Green Threads, this will block the entire JVM. Unless you have a single-threaded application, you should only use SelectSet.select() with native threads.
timeout | The maximum number of milliseconds to block waiting for an event to occur. A timeout of 0 means than select should not block; a timeout of -1 means that select should block indefinitely. |
Implements seda.nbio.SelectSetImpl.
synchronized SelectItem [] seda.nbio.SelectSetPollImpl.getEvents | ( | short | mask | ) | [package, virtual] |
Returns an array of SelectItems for which events matching the given event mask have occurred (that is, that the revents field matches the given mask).
This is a convenience method and is not meant to be optimized; since it scans the SelectItem array and creates a new reference array, it imposes higher overhead than the application scanning the SelectItem array directly, using the size() and elementAt() methods.
Implements seda.nbio.SelectSetImpl.
synchronized SelectItem [] seda.nbio.SelectSetPollImpl.getEvents | ( | ) | [package, virtual] |
Returns an array of SelectItems for which some events have occurred (that is, that the revents field is nonzero).
This is a convenience method and is not meant to be optimized; since it scans the SelectItem array and creates a new reference array, it imposes higher overhead than the application scanning the SelectItem array directly, using the size() and elementAt() methods.
Implements seda.nbio.SelectSetImpl.
String seda.nbio.SelectSetPollImpl.toString | ( | ) |
Vector seda.nbio.SelectSetPollImpl.vec [private] |
SelectItem seda.nbio.SelectSetPollImpl.itemarr[] [private] |
boolean seda.nbio.SelectSetPollImpl.needUpdate = false [private] |
int seda.nbio.SelectSetPollImpl.cachedActiveCount = -1 [private] |