com.jpeterson.x10
Class TransmitterEvent
java.lang.Object
|
+--java.util.EventObject
|
+--com.jpeterson.x10.ControlEvent
|
+--com.jpeterson.x10.TransmitterEvent
- public class TransmitterEvent
- extends ControlEvent
Event issued by Transmitter
to indicate a change in state or
other activity. A TransmitterEvent
is issued to each
TransmitterListener
attached to a Transmitter
using the addGatewayListener
method it inherits from the
Gateway
interface.
The TransmitterEvent
class extends the
GatewayEvent
class. Similarly, the
TransmitterListener
interface extends the
GatewayListener
interface.
TransmitterEvent
extends GatewayEvent
with
several events that are specialized for tranmitting. It also
inherits several event types from GatewayEvent
:
GATEWAY_ALLOCATED
, GATEWAY_DEALLOCATED
,
GATEWAY_ALLOCATING_RESOURCES
,
GATEWAY_DEALLOCATING_RESOURCES
, GATEWAY_PAUSED
,
GATEWAY_RESUMED
.
- See Also:
Transmitter
,
TransmitterListener
,
addGatewayListener
,
GatewayEvent
,
Form
, Serialized Form
Field Summary |
static int |
QUEUE_EMPTIED
The transmit queue of the Transmitter has emptied and
the Transmitter has changed to the
QUEUE_EMPTY state. |
static int |
QUEUE_UPDATED
The output queue has changed. |
protected boolean |
topOfQueueChanged
topOfQueueChanged is true for
QUEUE_UPDATED event when the top item in the
output queue has changed. |
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
TransmitterEvent(Transmitter source,
int id,
boolean topOfQueueChanged,
long oldGatewayState,
long newGatewayState)
Construct a TransmitterEvent with a specified event id
and topOfQueueChanged flag. |
Method Summary |
boolean |
getTopOfQueueChanged()
Return the topOfQueueChanged value. |
java.lang.String |
paramString()
Returns a parameter string identifying this event. |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
QUEUE_EMPTIED
public static final int QUEUE_EMPTIED
- The transmit queue of the
Transmitter
has emptied and
the Transmitter
has changed to the
QUEUE_EMPTY
state. The queue may become empty because
output of all items in the queue is completed.
- See Also:
queueEmptied
,
QUEUE_EMPTY
QUEUE_UPDATED
public static final int QUEUE_UPDATED
- The output queue has changed. This event may indicate a change
in state of the
Transmitter
from QUEUE_EMPTY
to QUEUE_NOT_EMPTY
. The event may also occur in the
QUEUE_NOT_EMPTY
state without changing state.
The output queue changes when (a) a new item is placed on the
queue with a call to one of the speak
methods or (b) when
output of the top item of
the queue is completed (again, without leaving an empty queue).
The topOfQueueChanged
boolean parameter is set to true if
the top item on the queue has changed.
- See Also:
queueUpdated
,
getTopOfQueueChanged
,
QUEUE_NOT_EMPTY
topOfQueueChanged
protected boolean topOfQueueChanged
topOfQueueChanged
is true
for
QUEUE_UPDATED
event when the top item in the
output queue has changed.
TransmitterEvent
public TransmitterEvent(Transmitter source,
int id,
boolean topOfQueueChanged,
long oldGatewayState,
long newGatewayState)
- Construct a
TransmitterEvent
with a specified event id
and topOfQueueChanged
flag.
- Parameters:
source
- the Transmitter
that issued the eventid
- the identifier for the event typetopOfQueueChanged
- true if top item on output queue changedoldGatewayState
- gateway state prior to this eventnewGatewayState
- gateway state following this event
getTopOfQueueChanged
public boolean getTopOfQueueChanged()
- Return the
topOfQueueChanged
value. The value is
true
for a QUEUE_UPDATED
event when the top
item in the output queue has changed.
- See Also:
topOfQueueChanged
paramString
public java.lang.String paramString()
- Returns a parameter string identifying this event. This method is
useful for event-logging and for debugging.
- Overrides:
- paramString in class ControlEvent
- Returns:
- a string identifying the event