Class NetworkTableUtils

java.lang.Object
frc.robot.utils.NetworkTableUtils

public class NetworkTableUtils extends Object
  • Constructor Details

    • NetworkTableUtils

      public NetworkTableUtils(String table)
      This class is a utility class for interfacing with network tables
      Parameters:
      table - The string ID for a network table
  • Method Details

    • getTable

      public edu.wpi.first.networktables.NetworkTable getTable()
      This function returns the table of this instance of NetworkTableUtils
      Returns:
      Returns the table as a NetworkTable
    • getDouble

      public double getDouble(String key, double defaultValue)
      This function gets a value from network tables as a double
      Parameters:
      key - The key in Network Tables for the value
      defaultValue - If the entry is not found or null we will return this
      Returns:
      Returns the Network Table entry as a double
    • getString

      public String getString(String key, String defaultValue)
      This function gets a value from network tables as a String
      Parameters:
      key - The key in Network Tables for the value
      defaultValue - If the entry is not found or null we will return this
      Returns:
      Returns the Network Table entry as a String
    • getDoubleArray

      public double[] getDoubleArray(String key, double[] doubles)
      This function gets a value from Network Tables as a double array
      Parameters:
      key - The key in Network Tables for the value
      doubles - If the entry is not found or null we will return this
      Returns:
      Returns the Network Table entry as a double array (double[])
    • setDoubleArray

      public void setDoubleArray(String key, double[] value)
    • setDouble

      public void setDouble(String key, double value)
      This function sets a double in network tables
      Parameters:
      key - The key in Network Tables for the value
      value - What we are setting the entry to
    • setString

      public void setString(String key, String value)
      This function sets a String in network tables
      Parameters:
      key - The key in Network Tables for the value
      value - What we are setting the entry to
    • getEntry

      public Object getEntry(String key, Object defaultValue)
      This function returns a entry as whatever it is
      Parameters:
      key - The key in Network Tables for the value
      defaultValue - We will return this is the entry is invalid
      Returns:
      Returns the entry as whatever it is
    • setEntry

      public void setEntry(String key, Object value)
      Sets a entry in Network Tables to a value
      Parameters:
      key - The key in Network Tables for the value
      value - The value we are setting the entry to.