Package edu.wpi.first.networktables
Class NetworkTableEvent
java.lang.Object
edu.wpi.first.networktables.NetworkTableEvent
public final class NetworkTableEvent extends Object
NetworkTables event.
There are different kinds of events. When creating a listener, a combination of event kinds can be listened to by building an EnumSet of NetworkTableEvent.Kind.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NetworkTableEvent.Kind
-
Field Summary
Fields Modifier and Type Field Description ConnectionInfo
connInfo
Connection information (for connection events).int
listener
Handle of listener that was triggered.LogMessage
logMessage
Log message (for log message events).TimeSyncEventData
timeSyncData
Log message (for log message events).TopicInfo
topicInfo
Topic information (for topic events).ValueEventData
valueData
Value data (for value events). -
Constructor Summary
Constructors Constructor Description NetworkTableEvent(NetworkTableInstance inst, int listener, int flags, ConnectionInfo connInfo, TopicInfo topicInfo, ValueEventData valueData, LogMessage logMessage, TimeSyncEventData timeSyncData)
Constructor. -
Method Summary
Modifier and Type Method Description NetworkTableInstance
getInstance()
Gets the instance associated with this event.boolean
is(NetworkTableEvent.Kind kind)
Determine if event is of a particular kind.
-
Field Details
-
listener
Handle of listener that was triggered. The value returned when adding the listener can be used to map this to a specific added listener. -
connInfo
Connection information (for connection events). -
topicInfo
Topic information (for topic events). -
valueData
Value data (for value events). -
logMessage
Log message (for log message events). -
timeSyncData
Log message (for log message events).
-
-
Constructor Details
-
NetworkTableEvent
public NetworkTableEvent(NetworkTableInstance inst, int listener, int flags, ConnectionInfo connInfo, TopicInfo topicInfo, ValueEventData valueData, LogMessage logMessage, TimeSyncEventData timeSyncData)Constructor. This should generally only be used internally to NetworkTables.- Parameters:
inst
- Instancelistener
- Listener that was triggeredflags
- Event flagsconnInfo
- Connection informationtopicInfo
- Topic informationvalueData
- Value datalogMessage
- Log messagetimeSyncData
- Time sync data
-
-
Method Details
-
is
Determine if event is of a particular kind. For example, kPublish if the topic was not previously published. Also indicates the data included with the event:- kConnected or kDisconnected: connInfo
- kPublish, kUnpublish, or kProperties: topicInfo
- kValueRemote, kValueLocal: valueData
- kLogMessage: logMessage
- Parameters:
kind
- Kind- Returns:
- True if event matches kind
-
getInstance
Gets the instance associated with this event.- Returns:
- Instance
-