Class PARTsNT

java.lang.Object
org.parts3492.partslib.network.PARTsNT

public class PARTsNT extends Object
PARTs NetworkTables Easy API.

PARTsNT partsNT = new PARTsNT(this)

This class is meant to be used as an instance for each class.

  • Field Details

  • Constructor Details

    • PARTsNT

      public PARTsNT()
      Creates a new PARTsNT instance.

      Creates/uses the subtable "Generic" instead of the class subtable.

      The object variation should be used instead.

    • PARTsNT

      public PARTsNT(Object o)
      Creates a new PARTsNT instance.

      Creates/uses the class subtable.

      Parameters:
      o - The class object. (E.g. passing in 'this'.)
    • PARTsNT

      public PARTsNT(String className)
      Creates a new PARTsNT instance.

      Creates/uses the subtable of the class via its name.

      If the name is empty, then the "Generic" table will be used instead.

      Parameters:
      className - The name of the class.
  • Method Details

    • getBoolean

      public boolean getBoolean(String name)
      Gets boolean value from the requested entry.
      Parameters:
      name - The topic name.
      Returns:
      Returns the boolean value if entry is found, otherwise returns false.
    • putBoolean

      public void putBoolean(String name, boolean value)
      Sets the boolean value for the requested entry.
      Parameters:
      name - The name of the entry.
      value - The new value to publish to the entry.
    • getInteger

      public int getInteger(String name)
      Gets the integer value from the requested entry.
      Parameters:
      name - The name of the entry.
      Returns:
      Returns the value if entry is found, otherwise returns zero.
    • putInteger

      public void putInteger(String name, int value)
      Sets the integer value for the requested entry.
      Parameters:
      name - The name of the entry.
      value - The new value to publish to the entry.
    • getDouble

      public double getDouble(String name)
      Gets the double value from the requested entry.
      Parameters:
      name - The name of the entry.
      Returns:
      Returns the value if entry is found, otherwise returns zero.
    • putDouble

      public void putDouble(String name, double value)
      Sets the double value for the requested entry.
      Parameters:
      name - The name of the entry.
      value - The new value to publish to the entry.
    • putNumber

      public void putNumber(String name, double value)
      Sets the double value for the requested entry.
      Parameters:
      name - The name of the entry.
      value - The new value to publish to the entry.
    • putNumber

      public void putNumber(String name, int value)
      Sets the integer value for the requested entry.
      Parameters:
      name - The name of the entry.
      value - The new value to publish to the entry.
    • getString

      public String getString(String name)
      Gets the string value from the requested entry.
      Parameters:
      name - The name of the entry.
      Returns:
      Returns the value if entry is found, otherwise returns an empty string.
    • putString

      public void putString(String name, String value)
      Sets the string value for the requested entry.
      Parameters:
      name - The name of the entry.
      value - The new value to publish to the entry.
    • removeAllEntries

      public void removeAllEntries()
      Removes all previously created entries.
    • removeEntry

      public void removeEntry(String name)
      Removes a previously created entry.
      Parameters:
      name - The name of the entry to remove.
    • putSmartDashboardSendable

      public void putSmartDashboardSendable(String key, edu.wpi.first.util.sendable.Sendable data)
      Adds a sendable to smart dashboard network table entry.
      Parameters:
      data - The sendable to add.