Class FloatTopic
public final class FloatTopic extends Topic
-
Field Summary
Fields Modifier and Type Field Description static String
kTypeString
The default type string for this topic type. -
Constructor Summary
Constructors Constructor Description FloatTopic(NetworkTableInstance inst, int handle)
Constructor; use NetworkTableInstance.getFloatTopic() instead.FloatTopic(Topic topic)
Construct from a generic topic. -
Method Summary
Modifier and Type Method Description FloatEntry
getEntry(float defaultValue, PubSubOption... options)
Create a new entry for the topic.FloatEntry
getEntryEx(String typeString, float defaultValue, PubSubOption... options)
Create a new entry for the topic, with specified type string.FloatPublisher
publish(PubSubOption... options)
Create a new publisher to the topic.FloatPublisher
publishEx(String typeString, String properties, PubSubOption... options)
Create a new publisher to the topic, with type string and initial properties.FloatSubscriber
subscribe(float defaultValue, PubSubOption... options)
Create a new subscriber to the topic.FloatSubscriber
subscribeEx(String typeString, float defaultValue, PubSubOption... options)
Create a new subscriber to the topic, with specified type string.Methods inherited from class edu.wpi.first.networktables.Topic
deleteProperty, equals, exists, genericPublish, genericPublishEx, genericSubscribe, genericSubscribe, getGenericEntry, getGenericEntry, getHandle, getInfo, getInstance, getName, getProperties, getProperty, getType, getTypeString, hashCode, isPersistent, isRetained, isValid, setPersistent, setProperties, setProperty, setRetained
-
Field Details
-
kTypeString
The default type string for this topic type.- See Also:
- Constant Field Values
-
-
Constructor Details
-
FloatTopic
Construct from a generic topic.- Parameters:
topic
- Topic
-
FloatTopic
Constructor; use NetworkTableInstance.getFloatTopic() instead.- Parameters:
inst
- Instancehandle
- Native handle
-
-
Method Details
-
subscribe
Create a new subscriber to the topic.The subscriber is only active as long as the returned object is not closed.
Subscribers that do not match the published data type do not return any values. To determine if the data type matches, use the appropriate Topic functions.
- Parameters:
defaultValue
- default value used when a default is not provided to a getter functionoptions
- subscribe options- Returns:
- subscriber
-
subscribeEx
Create a new subscriber to the topic, with specified type string.The subscriber is only active as long as the returned object is not closed.
Subscribers that do not match the published data type do not return any values. To determine if the data type matches, use the appropriate Topic functions.
- Parameters:
typeString
- type stringdefaultValue
- default value used when a default is not provided to a getter functionoptions
- subscribe options- Returns:
- subscriber
-
publish
Create a new publisher to the topic.The publisher is only active as long as the returned object is not closed.
It is not possible to publish two different data types to the same topic. Conflicts between publishers are typically resolved by the server on a first-come, first-served basis. Any published values that do not match the topic's data type are dropped (ignored). To determine if the data type matches, use the appropriate Topic functions.
- Parameters:
options
- publish options- Returns:
- publisher
-
publishEx
Create a new publisher to the topic, with type string and initial properties.The publisher is only active as long as the returned object is not closed.
It is not possible to publish two different data types to the same topic. Conflicts between publishers are typically resolved by the server on a first-come, first-served basis. Any published values that do not match the topic's data type are dropped (ignored). To determine if the data type matches, use the appropriate Topic functions.
- Parameters:
typeString
- type stringproperties
- JSON propertiesoptions
- publish options- Returns:
- publisher
- Throws:
IllegalArgumentException
- if properties is not a JSON object
-
getEntry
Create a new entry for the topic.Entries act as a combination of a subscriber and a weak publisher. The subscriber is active as long as the entry is not closed. The publisher is created when the entry is first written to, and remains active until either unpublish() is called or the entry is closed.
It is not possible to use two different data types with the same topic. Conflicts between publishers are typically resolved by the server on a first-come, first-served basis. Any published values that do not match the topic's data type are dropped (ignored), and the entry will show no new values if the data type does not match. To determine if the data type matches, use the appropriate Topic functions.
- Parameters:
defaultValue
- default value used when a default is not provided to a getter functionoptions
- publish and/or subscribe options- Returns:
- entry
-
getEntryEx
Create a new entry for the topic, with specified type string.Entries act as a combination of a subscriber and a weak publisher. The subscriber is active as long as the entry is not closed. The publisher is created when the entry is first written to, and remains active until either unpublish() is called or the entry is closed.
It is not possible to use two different data types with the same topic. Conflicts between publishers are typically resolved by the server on a first-come, first-served basis. Any published values that do not match the topic's data type are dropped (ignored), and the entry will show no new values if the data type does not match. To determine if the data type matches, use the appropriate Topic functions.
- Parameters:
typeString
- type stringdefaultValue
- default value used when a default is not provided to a getter functionoptions
- publish and/or subscribe options- Returns:
- entry
-