Package jmri.jmrix.loconet.locostats
Class LocoStatsFunc
- java.lang.Object
-
- jmri.jmrix.loconet.locostats.LocoStatsFunc
-
- All Implemented Interfaces:
java.util.EventListener
,LocoNetListener
public class LocoStatsFunc extends java.lang.Object implements LocoNetListener
Implements functionality to query the LocoNet interface device for status.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Vector<LocoNetInterfaceStatsListener>
listeners
-
Constructor Summary
Constructors Constructor Description LocoStatsFunc(LocoNetSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLocoNetInterfaceStatsListener(LocoNetInterfaceStatsListener l)
Add a listener to the list of listeners which will be notified upon receipt a LocoNet message containing interface statistics.void
dispose()
Free resources when no longer usedjava.lang.Object
getInterfaceStatus()
Get the latest interface statusvoid
message(LocoNetMessage msg)
LocoNet message handler.void
removeLocoNetInterfaceStatsListener(LocoNetInterfaceStatsListener l)
Remove a listener (if present) from the list of listeners which will be notified upon receipt LocoNet message containing interface statistics.void
sendLocoNetInterfaceStatusQueryMessage()
Request LocoNet interface Status
-
-
-
Field Detail
-
listeners
protected java.util.Vector<LocoNetInterfaceStatsListener> listeners
-
-
Constructor Detail
-
LocoStatsFunc
public LocoStatsFunc(LocoNetSystemConnectionMemo memo)
-
-
Method Detail
-
sendLocoNetInterfaceStatusQueryMessage
public void sendLocoNetInterfaceStatusQueryMessage()
Request LocoNet interface Status
-
message
public void message(LocoNetMessage msg)
LocoNet message handler.- Specified by:
message
in interfaceLocoNetListener
- Parameters:
msg
- incoming LocoNet message to be interpreted
-
getInterfaceStatus
public java.lang.Object getInterfaceStatus()
Get the latest interface status- Returns:
- the latest interface status; will be null if status has not been pulled.
-
dispose
public void dispose()
Free resources when no longer used
-
addLocoNetInterfaceStatsListener
public void addLocoNetInterfaceStatsListener(@Nonnull LocoNetInterfaceStatsListener l)
Add a listener to the list of listeners which will be notified upon receipt a LocoNet message containing interface statistics.- Parameters:
l
- LocoNetInterfaceStatsListener to be added
-
removeLocoNetInterfaceStatsListener
public void removeLocoNetInterfaceStatsListener(@Nonnull LocoNetInterfaceStatsListener l)
Remove a listener (if present) from the list of listeners which will be notified upon receipt LocoNet message containing interface statistics.- Parameters:
l
- LocoNetInterfaceStatsListener to be removed
-
-