Interface DoubleSubscriber
- All Superinterfaces:
AutoCloseable, DoubleSupplier, PubSub, Subscriber
- All Known Subinterfaces:
DoubleEntry
NetworkTables Double subscriber.
-
Method Summary
Modifier and TypeMethodDescriptiondoubleget()Get the last published value.doubleget(double defaultValue) Get the last published value.default doubleGet the last published value along with its timestamp If no value has been published, returns the stored default value and a timestamp of 0.getAtomic(double defaultValue) Get the last published value along with its timestamp If no value has been published, returns the passed defaultValue and a timestamp of 0.getTopic()Get the corresponding topic.Get an array of all value changes since the last call to readQueue.double[]Get an array of all value changes since the last call to readQueue.Methods inherited from interface Subscriber
exists, getLastChange
-
Method Details
-
getTopic
DoubleTopic getTopic()Get the corresponding topic. -
get
double get()Get the last published value. If no value has been published, returns the stored default value.- Returns:
- value
-
get
double get(double defaultValue) Get the last published value. If no value has been published, returns the passed defaultValue.- Parameters:
defaultValue- default value to return if no value has been published- Returns:
- value
-
getAsDouble
default double getAsDouble()- Specified by:
getAsDoublein interfaceDoubleSupplier
-
getAtomic
TimestampedDouble getAtomic()Get the last published value along with its timestamp If no value has been published, returns the stored default value and a timestamp of 0.- Returns:
- timestamped value
-
getAtomic
Get the last published value along with its timestamp If no value has been published, returns the passed defaultValue and a timestamp of 0.- Parameters:
defaultValue- default value to return if no value has been published- Returns:
- timestamped value
-
readQueue
TimestampedDouble[] readQueue()Get an array of all value changes since the last call to readQueue. Also provides a timestamp for each value.The "poll storage" subscribe option can be used to set the queue depth.
- Returns:
- Array of timestamped values; empty array if no new changes have been published since the previous call.
-
readQueueValues
double[] readQueueValues()Get an array of all value changes since the last call to readQueue.The "poll storage" subscribe option can be used to set the queue depth.
- Returns:
- Array of values; empty array if no new changes have been published since the previous call.
-