|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.loconet.LocoNetThrottledTransmitter
public class LocoNetThrottledTransmitter
Delay LocoNet messages that need to be throttled.
A LocoNetThrottledTransmitter object sits in front of a LocoNetInterface (e.g. TrafficHandler) and meters out specific LocoNet messages.
The internal Memo class is used to hold the pending message and the time it's to be sent. Time computations are in units of milliseconds, as that's all the accuracy that's needed here.
| Field Summary |
|---|
| Fields inherited from interface jmri.jmrix.loconet.LocoNetInterface |
|---|
ALL, POWER, PROGRAMMING, SENSORS, SLOTINFO, TURNOUTS |
| Constructor Summary | |
|---|---|
LocoNetThrottledTransmitter(LocoNetInterface controller)
|
|
| Method Summary | |
|---|---|
void |
addLocoNetListener(int mask,
LocoNetListener listener)
Request notification of things happening on the LocoNet. |
void |
dispose()
Cease operation, no more messages can be sent |
void |
removeLocoNetListener(int mask,
LocoNetListener listener)
|
void |
sendLocoNetMessage(LocoNetMessage msg)
Accept a message to be sent after suitable delay. |
boolean |
status()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocoNetThrottledTransmitter(LocoNetInterface controller)
| Method Detail |
|---|
public void dispose()
public void addLocoNetListener(int mask,
LocoNetListener listener)
LocoNetInterfaceThe same listener can register multiple times with different masks. (Multiple registrations with a single mask value are equivalent to a single registration) Mask values are defined as class constants. Note that these are bit masks, and should be OR'd, not added, if multiple values are desired.
The event notification contains the received message as source, not this object, so that we can notify of an incoming message to multiple places and then move on.
addLocoNetListener in interface LocoNetInterfacemask - The OR of the key values of messages to be reported (to reduce traffic,
provide for listeners interested in different things)listener - Object to be notified of new messages as they arrive.
public void removeLocoNetListener(int mask,
LocoNetListener listener)
removeLocoNetListener in interface LocoNetInterfacepublic boolean status()
status in interface LocoNetInterfacepublic void sendLocoNetMessage(LocoNetMessage msg)
sendLocoNetMessage in interface LocoNetInterface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||