Package edu.wpi.first.networktables
Class NetworkTableEvent
java.lang.Object
edu.wpi.first.networktables.NetworkTableEvent
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
-
Field Summary
Modifier and TypeFieldDescriptionfinal ConnectionInfo
Connection information (for connection events).final int
Handle of listener that was triggered.final LogMessage
Log message (for log message events).final TimeSyncEventData
Log message (for log message events).final TopicInfo
Topic information (for topic events).final ValueEventData
Value data (for value events). -
Constructor Summary
ConstructorDescriptionNetworkTableEvent
(NetworkTableInstance inst, int listener, int flags, ConnectionInfo connInfo, TopicInfo topicInfo, ValueEventData valueData, LogMessage logMessage, TimeSyncEventData timeSyncData) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets 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
-