Class NetworkTable

    • Field Detail

      • PATH_SEPARATOR

        public static final char PATH_SEPARATOR
        Deprecated.
        The path separator for sub-tables and keys
        See Also:
        Constant Field Values
      • DEFAULT_PORT

        public static final int DEFAULT_PORT
        Deprecated.
        The default port that network tables operates on
        See Also:
        Constant Field Values
      • PERSISTENT

        public static final int PERSISTENT
        Deprecated.
        The persistent flag value.
        See Also:
        Constant Field Values
    • Method Detail

      • setPersistentFilename

        @Deprecated
        public static void setPersistentFilename​(String filename)
        Deprecated.
        Use the appropriate parameter to NetworkTableInstance.startServer() instead.
        Sets the persistent filename.
        Parameters:
        filename - the filename that the network tables server uses for automatic loading and saving of persistent values
      • toNative

        public static boolean[] toNative​(Boolean[] arr)
        Deprecated.
      • toNative

        public static double[] toNative​(Number[] arr)
        Deprecated.
      • fromNative

        public static Boolean[] fromNative​(boolean[] arr)
        Deprecated.
      • fromNative

        public static Double[] fromNative​(double[] arr)
        Deprecated.
      • getTable

        @Deprecated
        public static NetworkTable getTable​(String key)
        Deprecated.
        Gets the table with the specified key. If the table does not exist, a new table will be created.
        This will automatically initialize network tables if it has not been already
        Parameters:
        key - the key name
        Returns:
        the network table requested
      • getSubTable

        public ITable getSubTable​(String key)
        Deprecated.
        Returns the table at the specified key. If there is no table at the specified key, it will create a new table
        Specified by:
        getSubTable in interface ITable
        Parameters:
        key - the name of the table relative to this one
        Returns:
        a sub table relative to this one
      • containsKey

        public boolean containsKey​(String key)
        Deprecated.
        Checks the table and tells if it contains the specified key
        Specified by:
        containsKey in interface ITable
        Parameters:
        key - the key to search for
        Returns:
        true if the table as a value assigned to the given key
      • containsSubTable

        public boolean containsSubTable​(String key)
        Deprecated.
        Specified by:
        containsSubTable in interface ITable
        Parameters:
        key - the key to search for
        Returns:
        true if there is a subtable with the key which contains at least one key/subtable of its own
      • getKeys

        public Set<String> getKeys​(int types)
        Deprecated.
        Description copied from interface: ITable
        Gets all keys in the table (not including sub-tables).
        Specified by:
        getKeys in interface ITable
        Parameters:
        types - bitmask of types; 0 is treated as a "don't care".
        Returns:
        keys currently in the table
      • getKeys

        public Set<String> getKeys()
        Deprecated.
        Gets all keys in the table (not including sub-tables).
        Specified by:
        getKeys in interface ITable
        Returns:
        keys currently in the table
      • getSubTables

        public Set<String> getSubTables()
        Deprecated.
        Gets the names of all subtables in the table.
        Specified by:
        getSubTables in interface ITable
        Returns:
        subtables currently in the table
      • putNumber

        public boolean putNumber​(String key,
                                 double value)
        Deprecated.
        Put a number in the table
        Specified by:
        putNumber in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultNumber

        public boolean setDefaultNumber​(String key,
                                        double defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultNumber in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getNumber

        public double getNumber​(String key,
                                double defaultValue)
        Deprecated.
        Returns the number the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getNumber in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putString

        public boolean putString​(String key,
                                 String value)
        Deprecated.
        Put a string in the table
        Specified by:
        putString in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultString

        public boolean setDefaultString​(String key,
                                        String defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultString in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getString

        public String getString​(String key,
                                String defaultValue)
        Deprecated.
        Returns the string the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getString in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putBoolean

        public boolean putBoolean​(String key,
                                  boolean value)
        Deprecated.
        Put a boolean in the table
        Specified by:
        putBoolean in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultBoolean

        public boolean setDefaultBoolean​(String key,
                                         boolean defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultBoolean in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getBoolean

        public boolean getBoolean​(String key,
                                  boolean defaultValue)
        Deprecated.
        Returns the boolean the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getBoolean in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putBooleanArray

        public boolean putBooleanArray​(String key,
                                       boolean[] value)
        Deprecated.
        Put a boolean array in the table
        Specified by:
        putBooleanArray in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • putBooleanArray

        public boolean putBooleanArray​(String key,
                                       Boolean[] value)
        Deprecated.
        Put a boolean array in the table
        Specified by:
        putBooleanArray in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultBooleanArray

        public boolean setDefaultBooleanArray​(String key,
                                              boolean[] defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultBooleanArray in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • setDefaultBooleanArray

        public boolean setDefaultBooleanArray​(String key,
                                              Boolean[] defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultBooleanArray in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getBooleanArray

        public boolean[] getBooleanArray​(String key,
                                         boolean[] defaultValue)
        Deprecated.
        Returns the boolean array the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getBooleanArray in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • getBooleanArray

        public Boolean[] getBooleanArray​(String key,
                                         Boolean[] defaultValue)
        Deprecated.
        Returns the boolean array the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getBooleanArray in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putNumberArray

        public boolean putNumberArray​(String key,
                                      double[] value)
        Deprecated.
        Put a number array in the table
        Specified by:
        putNumberArray in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • putNumberArray

        public boolean putNumberArray​(String key,
                                      Double[] value)
        Deprecated.
        Put a number array in the table
        Specified by:
        putNumberArray in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultNumberArray

        public boolean setDefaultNumberArray​(String key,
                                             double[] defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultNumberArray in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • setDefaultNumberArray

        public boolean setDefaultNumberArray​(String key,
                                             Double[] defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultNumberArray in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getNumberArray

        public double[] getNumberArray​(String key,
                                       double[] defaultValue)
        Deprecated.
        Returns the number array the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getNumberArray in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • getNumberArray

        public Double[] getNumberArray​(String key,
                                       Double[] defaultValue)
        Deprecated.
        Returns the number array the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getNumberArray in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putStringArray

        public boolean putStringArray​(String key,
                                      String[] value)
        Deprecated.
        Put a string array in the table
        Specified by:
        putStringArray in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultStringArray

        public boolean setDefaultStringArray​(String key,
                                             String[] defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultStringArray in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getStringArray

        public String[] getStringArray​(String key,
                                       String[] defaultValue)
        Deprecated.
        Returns the string array the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getStringArray in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putRaw

        public boolean putRaw​(String key,
                              byte[] value)
        Deprecated.
        Put a raw value (byte array) in the table
        Specified by:
        putRaw in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultRaw

        public boolean setDefaultRaw​(String key,
                                     byte[] defaultValue)
        Deprecated.
        Gets the current value in the table, setting it if it does not exist.
        Specified by:
        setDefaultRaw in interface ITable
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • putRaw

        public boolean putRaw​(String key,
                              ByteBuffer value,
                              int len)
        Deprecated.
        Put a raw value (bytes from a byte buffer) in the table
        Specified by:
        putRaw in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        len - the length of the value
        Returns:
        False if the table key already exists with a different type
      • getRaw

        public byte[] getRaw​(String key,
                             byte[] defaultValue)
        Deprecated.
        Returns the raw value (byte array) the key maps to. If the key does not exist or is of different type, it will return the default value.
        Specified by:
        getRaw in interface ITable
        Parameters:
        key - the key to look up
        defaultValue - the value to be returned if no value is found
        Returns:
        the value associated with the given key or the given default value if there is no value associated with the key
      • putValue

        public boolean putValue​(String key,
                                NetworkTableValue value)
        Deprecated.
        Put a value in the table
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
      • setDefaultValue

        public boolean setDefaultValue​(String key,
                                       NetworkTableValue defaultValue)
        Deprecated.
        Sets the current value in the table if it does not exist.
        Parameters:
        key - the key
        defaultValue - the default value to set if key doens't exist.
        Returns:
        False if the table key exists with a different type
      • getValue

        public NetworkTableValue getValue​(String key)
        Deprecated.
        Gets the value associated with a key as a NetworkTableValue object.
        Parameters:
        key - the key of the value to look up
        Returns:
        the value associated with the given key
      • putValue

        @Deprecated
        public boolean putValue​(String key,
                                Object value)
                         throws IllegalArgumentException
        Deprecated.
        Use NetworkTableEntry.setValue(Object) instead, e.g. `NetworkTable.getEntry(key).setValue(NetworkTableEntry.makeBoolean(false));` or `NetworkTable.getEntry(key).setValue(new Boolean(false));`
        Put a value in the table
        Specified by:
        putValue in interface ITable
        Parameters:
        key - the key to be assigned to
        value - the value that will be assigned
        Returns:
        False if the table key already exists with a different type
        Throws:
        IllegalArgumentException - when the value is not supported by the table
      • getValue

        @Deprecated
        public Object getValue​(String key,
                               Object defaultValue)
        Deprecated.
        Use NetworkTableEntry.getValue() instead, e.g. `NetworkTable.getEntry(key).getValue();`
        Gets the value associated with a key as an object. NOTE: If the value is a double, it will return a Double object, not a primitive. To get the primitive, use ITable.getDouble(String, double).
        Specified by:
        getValue in interface ITable
        Parameters:
        key - the key of the value to look up
        defaultValue - the default value if the key is null
        Returns:
        the value associated with the given key
      • setPersistent

        public void setPersistent​(String key)
        Deprecated.
        Makes a key's value persistent through program restarts. The key cannot be null.
        Specified by:
        setPersistent in interface ITable
        Parameters:
        key - the key name
      • clearPersistent

        public void clearPersistent​(String key)
        Deprecated.
        Stop making a key's value persistent through program restarts. The key cannot be null.
        Specified by:
        clearPersistent in interface ITable
        Parameters:
        key - the key name
      • isPersistent

        public boolean isPersistent​(String key)
        Deprecated.
        Returns whether the value is persistent through program restarts. The key cannot be null.
        Specified by:
        isPersistent in interface ITable
        Parameters:
        key - the key name
        Returns:
        True if the value is persistent.
      • setFlags

        public void setFlags​(String key,
                             int flags)
        Deprecated.
        Sets flags on the specified key in this table. The key can not be null.
        Specified by:
        setFlags in interface ITable
        Parameters:
        key - the key name
        flags - the flags to set (bitmask)
      • clearFlags

        public void clearFlags​(String key,
                               int flags)
        Deprecated.
        Clears flags on the specified key in this table. The key can not be null.
        Specified by:
        clearFlags in interface ITable
        Parameters:
        key - the key name
        flags - the flags to clear (bitmask)
      • getFlags

        public int getFlags​(String key)
        Deprecated.
        Returns the flags for the specified key.
        Specified by:
        getFlags in interface ITable
        Parameters:
        key - the key name
        Returns:
        the flags, or 0 if the key is not defined
      • delete

        public void delete​(String key)
        Deprecated.
        Deletes the specified key in this table. The key can not be null.
        Specified by:
        delete in interface ITable
        Parameters:
        key - the key name
      • flush

        @Deprecated
        public static void flush()
        Deprecated.
        Flushes all updated values immediately to the network. Note: This is rate-limited to protect the network from flooding. This is primarily useful for synchronizing network updates with user code.
      • putDouble

        @Deprecated
        public boolean putDouble​(String key,
                                 double value)
        Deprecated.
        Maps the specified key to the specified value in this table. The key can not be null. The value can be retrieved by calling the get method with a key that is equal to the original key.
        Specified by:
        putDouble in interface ITable
        Parameters:
        key - the key
        value - the value
        Returns:
        False if the table key already exists with a different type
      • getDouble

        @Deprecated
        public double getDouble​(String key,
                                double defaultValue)
        Deprecated.
        Returns the value at the specified key.
        Specified by:
        getDouble in interface ITable
        Parameters:
        key - the key
        defaultValue - the value returned if the key is undefined
        Returns:
        the value
      • getPath

        public String getPath()
        Deprecated.
        Gets the full path of this table. Does not include the trailing "/".
        Specified by:
        getPath in interface ITable
        Returns:
        The path to this table (e.g. "", "/foo").
      • equals

        public boolean equals​(Object o)
        Deprecated.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object