Interface BooleanSubscriber

All Superinterfaces:
AutoCloseable, BooleanSupplier, PubSub, Subscriber
All Known Subinterfaces:
BooleanEntry

public interface BooleanSubscriber
extends Subscriber, BooleanSupplier
NetworkTables Boolean subscriber.
  • Method Summary

    Modifier and Type Method Description
    boolean get()
    Get the last published value.
    boolean get​(boolean defaultValue)
    Get the last published value.
    default boolean getAsBoolean()  
    TimestampedBoolean 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.
    TimestampedBoolean getAtomic​(boolean 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.
    BooleanTopic getTopic()
    Get the corresponding topic.
    TimestampedBoolean[] readQueue()
    Get an array of all value changes since the last call to readQueue.
    boolean[] readQueueValues()
    Get an array of all value changes since the last call to readQueue.

    Methods inherited from interface edu.wpi.first.networktables.PubSub

    close, getHandle, isValid

    Methods inherited from interface edu.wpi.first.networktables.Subscriber

    exists, getLastChange
  • Method Details

    • getTopic

      Get the corresponding topic.
      Specified by:
      getTopic in interface PubSub
      Returns:
      Topic
    • get

      boolean get()
      Get the last published value. If no value has been published, returns the stored default value.
      Returns:
      value
    • get

      boolean get​(boolean 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
    • getAsBoolean

      default boolean getAsBoolean()
      Specified by:
      getAsBoolean in interface BooleanSupplier
    • 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

      TimestampedBoolean getAtomic​(boolean 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.
      Parameters:
      defaultValue - default value to return if no value has been published
      Returns:
      timestamped value
    • 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

      boolean[] 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.