|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpyrasun.eio.EIOEvent
Describes a single event-type that can be handled by the EmberIO system. Events include things like READ (there's data available to read from an Endpoint), WRITE (you might be able to squeeze out a few bytes writing to an endpoint), PROCESS (there's data available to process from the Endpoint), etc. You can (will be able to...) define your own EIOEvents if you want to define something of our own outside of NIO. The are only a few constraints on this:
- The ID for a user-defined event must fall between USER_BITS_LOW and
USER_BITS_HIGH, inclusive.
- The ID _must_ be a single bit e.g. (1 << USER_BITS_LOW) would
be acceptable, USER_BITS_LOW+5 would not be.
| Field Summary | |
static EIOEvent |
ACCEPT
An accept event. |
static EIOEvent |
CONNECT
A connect event - currently not supported. |
static int |
NIO_RESERVED_IDS
IDs reserved for now and future NIO use. |
static int |
NIO_SELECTOR_EVENTS
Event ID bit mask for all events that may be used within an NIO Selector. |
static EIOEvent |
PROCESS
A Process event. |
static EIOEvent |
READ
A read event, indicating that data maybe available to read from an Endpoint. |
static int |
USER_BITS_HIGH
High end of User ID bit-space. |
static int |
USER_BITS_LOW
Low end of User ID bit-space. |
static EIOEvent |
WRITE
A write event - you may be able to write some data out to an endpoint. |
| Constructor Summary | |
EIOEvent(java.lang.String eventName,
int id)
Create a new EIOEvent |
|
| Method Summary | |
int |
bit()
Get the bit number for this event's ID e.g. an ID of 1 would return 0, 2 returns 1, 4 returns 2, 8 returns 3, etc. |
static int |
bitFor(int flag)
Given an EIOEvent flag ID value, returns the bit number for it. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getEventName()
Get the wetware readable name of this event. |
java.lang.Integer |
getID()
Get the ID of this event as an Integer |
static int |
getNIOSelectorEvents()
Get the complete bitmask for all events that are selectable via an NIO Selector |
int |
hashCode()
|
int |
id()
Get the ID of this event as an int |
static boolean |
isNIOSelectorEvent(EIOEvent event)
Returns true if the event passed in are selectable via an NIO Selector. |
static boolean |
isNIOSelectorEvent(int event)
Returns true if the event (or events) passed in are selectable via an NIO Selector. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NIO_RESERVED_IDS
public static final EIOEvent READ
public static final EIOEvent WRITE
public static final EIOEvent CONNECT
public static final EIOEvent ACCEPT
public static final EIOEvent PROCESS
public static final int USER_BITS_LOW
public static final int USER_BITS_HIGH
public static final int NIO_SELECTOR_EVENTS
| Constructor Detail |
public EIOEvent(java.lang.String eventName,
int id)
eventName - The name of the event in wetware-readable formid - The ID of the event. This _must_ be a single bit!!| Method Detail |
public static boolean isNIOSelectorEvent(int event)
event - Event bitmask
public static boolean isNIOSelectorEvent(EIOEvent event)
event - - the event yuse want to know if it is like NIO Selectable.
public static int getNIOSelectorEvents()
public java.lang.String getEventName()
public java.lang.Integer getID()
public int id()
public int bit()
public static int bitFor(int flag)
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||