Class NetworkTable
- java.lang.Object
-
- edu.wpi.first.wpilibj.networktables.NetworkTable
-
@Deprecated public class NetworkTable extends Object implements ITable, IRemote
Deprecated.UseNetworkTable
instead.A network table that knows its subtable path.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PORT
Deprecated.The default port that network tables operates onstatic char
PATH_SEPARATOR
Deprecated.The path separator for sub-tables and keysstatic int
PERSISTENT
Deprecated.The persistent flag value.-
Fields inherited from interface edu.wpi.first.wpilibj.tables.ITable
NOTIFY_DELETE, NOTIFY_FLAGS, NOTIFY_IMMEDIATE, NOTIFY_LOCAL, NOTIFY_NEW, NOTIFY_UPDATE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify)
Deprecated.static void
addGlobalConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify)
Deprecated.void
addSubTableListener(ITableListener listener)
Deprecated.void
addSubTableListener(ITableListener listener, boolean localNotify)
Deprecated.void
addTableListener(ITableListener listener)
Deprecated.UseNetworkTable.addEntryListener(TableEntryListener, int)
instead (with flags value of NOTIFY_NEW | NOTIFY_UPDATE).void
addTableListener(ITableListener listener, boolean immediateNotify)
Deprecated.UseNetworkTable.addEntryListener(TableEntryListener, int)
instead (with flags value of NOTIFY_NEW | NOTIFY_UPDATE | NOTIFY_IMMEDIATE).void
addTableListener(String key, ITableListener listener, boolean immediateNotify)
Deprecated.void
addTableListenerEx(ITableListener listener, int flags)
Deprecated.void
addTableListenerEx(String key, ITableListener listener, int flags)
Deprecated.void
clearFlags(String key, int flags)
Deprecated.Clears flags on the specified key in this table.void
clearPersistent(String key)
Deprecated.Stop making a key's value persistent through program restarts.static ConnectionInfo[]
connections()
Deprecated.UseNetworkTableInstance.getConnections()
instead.boolean
containsKey(String key)
Deprecated.Checks the table and tells if it contains the specified keyboolean
containsSubTable(String key)
Deprecated.void
delete(String key)
Deprecated.Deletes the specified key in this table.boolean
equals(Object o)
Deprecated.static void
flush()
Deprecated.UseNetworkTableInstance.flush()
instead.static Boolean[]
fromNative(boolean[] arr)
Deprecated.static Double[]
fromNative(double[] arr)
Deprecated.boolean
getBoolean(String key, boolean defaultValue)
Deprecated.Returns the boolean the key maps to.boolean[]
getBooleanArray(String key, boolean[] defaultValue)
Deprecated.Returns the boolean array the key maps to.Boolean[]
getBooleanArray(String key, Boolean[] defaultValue)
Deprecated.Returns the boolean array the key maps to.double
getDouble(String key, double defaultValue)
Deprecated.UsegetNumber(String, double)
instead.int
getFlags(String key)
Deprecated.Returns the flags for the specified key.Set<String>
getKeys()
Deprecated.Gets all keys in the table (not including sub-tables).Set<String>
getKeys(int types)
Deprecated.Gets all keys in the table (not including sub-tables).double
getNumber(String key, double defaultValue)
Deprecated.Returns the number the key maps to.double[]
getNumberArray(String key, double[] defaultValue)
Deprecated.Returns the number array the key maps to.Double[]
getNumberArray(String key, Double[] defaultValue)
Deprecated.Returns the number array the key maps to.String
getPath()
Deprecated.Gets the full path of this table.byte[]
getRaw(String key, byte[] defaultValue)
Deprecated.Returns the raw value (byte array) the key maps to.String
getString(String key, String defaultValue)
Deprecated.Returns the string the key maps to.String[]
getStringArray(String key, String[] defaultValue)
Deprecated.Returns the string array the key maps to.ITable
getSubTable(String key)
Deprecated.Returns the table at the specified key.Set<String>
getSubTables()
Deprecated.Gets the names of all subtables in the table.static NetworkTable
getTable(String key)
Deprecated.UseNetworkTableInstance.getTable(String)
instead.NetworkTableValue
getValue(String key)
Deprecated.Gets the value associated with a key as a NetworkTableValue object.Object
getValue(String key, Object defaultValue)
Deprecated.UseNetworkTableEntry.getValue()
instead, e.g.static void
globalDeleteAll()
Deprecated.UseNetworkTableInstance.deleteAllEntries()
instead.int
hashCode()
Deprecated.static void
initialize()
Deprecated.UseNetworkTableInstance.startServer()
orNetworkTableInstance.startClient()
instead.boolean
isConnected()
Deprecated.UseNetworkTableInstance.isConnected()
instead.boolean
isPersistent(String key)
Deprecated.Returns whether the value is persistent through program restarts.boolean
isServer()
Deprecated.UseNetworkTableInstance.getNetworkMode()
instead.static String[]
loadPersistent(String filename)
Deprecated.UseNetworkTableInstance.loadPersistent(String)
instead.boolean
putBoolean(String key, boolean value)
Deprecated.Put a boolean in the tableboolean
putBooleanArray(String key, boolean[] value)
Deprecated.Put a boolean array in the tableboolean
putBooleanArray(String key, Boolean[] value)
Deprecated.Put a boolean array in the tableboolean
putDouble(String key, double value)
Deprecated.UseputNumber(String, double)
instead.boolean
putNumber(String key, double value)
Deprecated.Put a number in the tableboolean
putNumberArray(String key, double[] value)
Deprecated.Put a number array in the tableboolean
putNumberArray(String key, Double[] value)
Deprecated.Put a number array in the tableboolean
putRaw(String key, byte[] value)
Deprecated.Put a raw value (byte array) in the tableboolean
putRaw(String key, ByteBuffer value, int len)
Deprecated.Put a raw value (bytes from a byte buffer) in the tableboolean
putString(String key, String value)
Deprecated.Put a string in the tableboolean
putStringArray(String key, String[] value)
Deprecated.Put a string array in the tableboolean
putValue(String key, NetworkTableValue value)
Deprecated.Put a value in the tableboolean
putValue(String key, Object value)
Deprecated.UseNetworkTableEntry.setValue(Object)
instead, e.g.void
removeConnectionListener(IRemoteConnectionListener listener)
Deprecated.UseNetworkTableInstance.removeConnectionListener(int)
instead.static void
removeGlobalConnectionListener(IRemoteConnectionListener listener)
Deprecated.UseNetworkTableInstance.removeConnectionListener(int)
instead.void
removeTableListener(ITableListener listener)
Deprecated.UseNetworkTable.removeTableListener(int)
instead.static void
savePersistent(String filename)
Deprecated.UseNetworkTableInstance.savePersistent(String)
instead.static void
setClientMode()
Deprecated.UseNetworkTableInstance.startClient()
instead.boolean
setDefaultBoolean(String key, boolean defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultBooleanArray(String key, boolean[] defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultBooleanArray(String key, Boolean[] defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultNumber(String key, double defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultNumberArray(String key, double[] defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultNumberArray(String key, Double[] defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultRaw(String key, byte[] defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultString(String key, String defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultStringArray(String key, String[] defaultValue)
Deprecated.Gets the current value in the table, setting it if it does not exist.boolean
setDefaultValue(String key, NetworkTableValue defaultValue)
Deprecated.Sets the current value in the table if it does not exist.static void
setDSClientEnabled(boolean enabled)
Deprecated.UseNetworkTableInstance.startDSClient()
andNetworkTableInstance.stopDSClient()
instead.void
setFlags(String key, int flags)
Deprecated.Sets flags on the specified key in this table.static void
setIPAddress(String address)
Deprecated.static void
setIPAddress(String[] addresses)
Deprecated.static void
setNetworkIdentity(String name)
Deprecated.UseNetworkTableInstance.setNetworkIdentity(String)
instead.void
setPersistent(String key)
Deprecated.Makes a key's value persistent through program restarts.static void
setPersistentFilename(String filename)
Deprecated.Use the appropriate parameter toNetworkTableInstance.startServer()
instead.static void
setPort(int aport)
Deprecated.Use the appropriate parameters toNetworkTableInstance.setServer(String, int)
,NetworkTableInstance.startClient(String, int)
,NetworkTableInstance.startServer(String, String, int)
, andNetworkTableInstance.startDSClient(int)
instead.static void
setServerMode()
Deprecated.UseNetworkTableInstance.startServer()
instead.static void
setTeam(int team)
Deprecated.static void
setUpdateRate(double interval)
Deprecated.UseNetworkTableInstance.setUpdateRate(double)
instead.static void
shutdown()
Deprecated.UseNetworkTableInstance.stopServer()
orNetworkTableInstance.stopClient()
instead.static boolean[]
toNative(Boolean[] arr)
Deprecated.static double[]
toNative(Number[] arr)
Deprecated.String
toString()
Deprecated.
-
-
-
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
-
initialize
@Deprecated public static void initialize()
Deprecated.UseNetworkTableInstance.startServer()
orNetworkTableInstance.startClient()
instead.initializes network tables
-
shutdown
@Deprecated public static void shutdown()
Deprecated.UseNetworkTableInstance.stopServer()
orNetworkTableInstance.stopClient()
instead.shuts down network tables
-
setServerMode
@Deprecated public static void setServerMode()
Deprecated.UseNetworkTableInstance.startServer()
instead.set that network tables should be a server This must be called before initialize or getTable
-
setClientMode
@Deprecated public static void setClientMode()
Deprecated.UseNetworkTableInstance.startClient()
instead.set that network tables should be a client This must be called before initialize or getTable
-
setTeam
@Deprecated public static void setTeam(int team)
Deprecated.set the team the robot is configured for (this will set the mdns address that network tables will connect to in client mode) This must be called before initialize or getTable- Parameters:
team
- the team number
-
setIPAddress
@Deprecated public static void setIPAddress(String address)
Deprecated.- Parameters:
address
- the address that network tables will connect to in client mode
-
setIPAddress
@Deprecated public static void setIPAddress(String[] addresses)
Deprecated.- Parameters:
addresses
- the adresses that network tables will connect to in client mode (in round robin order)
-
setPort
@Deprecated public static void setPort(int aport)
Deprecated.Use the appropriate parameters toNetworkTableInstance.setServer(String, int)
,NetworkTableInstance.startClient(String, int)
,NetworkTableInstance.startServer(String, String, int)
, andNetworkTableInstance.startDSClient(int)
instead.Set the port number that network tables will connect to in client mode or listen to in server mode.- Parameters:
aport
- the port number
-
setDSClientEnabled
@Deprecated public static void setDSClientEnabled(boolean enabled)
Deprecated.UseNetworkTableInstance.startDSClient()
andNetworkTableInstance.stopDSClient()
instead.Enable requesting the server address from the Driver Station.- Parameters:
enabled
- whether to enable the connection to the local DS
-
setPersistentFilename
@Deprecated public static void setPersistentFilename(String filename)
Deprecated.Use the appropriate parameter toNetworkTableInstance.startServer()
instead.Sets the persistent filename.- Parameters:
filename
- the filename that the network tables server uses for automatic loading and saving of persistent values
-
setNetworkIdentity
@Deprecated public static void setNetworkIdentity(String name)
Deprecated.UseNetworkTableInstance.setNetworkIdentity(String)
instead.Sets the network identity. This is provided in the connection info on the remote end.- Parameters:
name
- identity
-
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.UseNetworkTableInstance.getTable(String)
instead.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
-
connections
@Deprecated public static ConnectionInfo[] connections()
Deprecated.UseNetworkTableInstance.getConnections()
instead.Gets the current network connections.- Returns:
- An array of connection information.
-
isConnected
@Deprecated public boolean isConnected()
Deprecated.UseNetworkTableInstance.isConnected()
instead.Determine whether or not a network connection is active.- Specified by:
isConnected
in interfaceIRemote
- Returns:
- True if connected, false if not connected.
-
isServer
@Deprecated public boolean isServer()
Deprecated.UseNetworkTableInstance.getNetworkMode()
instead.Determine whether NetworkTables is operating as a server or as a client.
-
addGlobalConnectionListener
@Deprecated public static void addGlobalConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify)
Deprecated.Add a connection listener.- Parameters:
listener
- connection listenerimmediateNotify
- call listener immediately for all existing connections
-
removeGlobalConnectionListener
@Deprecated public static void removeGlobalConnectionListener(IRemoteConnectionListener listener)
Deprecated.UseNetworkTableInstance.removeConnectionListener(int)
instead.Remove a connection listener.- Parameters:
listener
- connection listener
-
addConnectionListener
@Deprecated public void addConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify)
Deprecated.Add a connection listener.- Specified by:
addConnectionListener
in interfaceIRemote
- Parameters:
listener
- connection listenerimmediateNotify
- call listener immediately for all existing connections
-
removeConnectionListener
@Deprecated public void removeConnectionListener(IRemoteConnectionListener listener)
Deprecated.UseNetworkTableInstance.removeConnectionListener(int)
instead.Remove a connection listener.- Specified by:
removeConnectionListener
in interfaceIRemote
- Parameters:
listener
- connection listener
-
addTableListener
@Deprecated public void addTableListener(ITableListener listener)
Deprecated.UseNetworkTable.addEntryListener(TableEntryListener, int)
instead (with flags value of NOTIFY_NEW | NOTIFY_UPDATE).Add a listener for changes to the table- Specified by:
addTableListener
in interfaceITable
- Parameters:
listener
- the listener to add
-
addTableListener
@Deprecated public void addTableListener(ITableListener listener, boolean immediateNotify)
Deprecated.UseNetworkTable.addEntryListener(TableEntryListener, int)
instead (with flags value of NOTIFY_NEW | NOTIFY_UPDATE | NOTIFY_IMMEDIATE).Add a listener for changes to the table- Specified by:
addTableListener
in interfaceITable
- Parameters:
listener
- the listener to addimmediateNotify
- if true then this listener will be notified of all current entries (marked as new)
-
addTableListenerEx
@Deprecated public void addTableListenerEx(ITableListener listener, int flags)
Deprecated.Add a listener for changes to the table- Specified by:
addTableListenerEx
in interfaceITable
- Parameters:
listener
- the listener to addflags
- bitmask specifying desired notifications
-
addTableListener
@Deprecated public void addTableListener(String key, ITableListener listener, boolean immediateNotify)
Deprecated.Add a listener for changes to a specific key the table- Specified by:
addTableListener
in interfaceITable
- Parameters:
key
- the key to listen forlistener
- the listener to addimmediateNotify
- if true then this listener will be notified of all current entries (marked as new)
-
addTableListenerEx
@Deprecated public void addTableListenerEx(String key, ITableListener listener, int flags)
Deprecated.Add a listener for changes to a specific key the table- Specified by:
addTableListenerEx
in interfaceITable
- Parameters:
key
- the key to listen forlistener
- the listener to addflags
- bitmask specifying desired notifications
-
addSubTableListener
@Deprecated public void addSubTableListener(ITableListener listener)
Deprecated.This will immediately notify the listener of all current sub tables- Specified by:
addSubTableListener
in interfaceITable
- Parameters:
listener
- the listener to notify
-
addSubTableListener
@Deprecated public void addSubTableListener(ITableListener listener, boolean localNotify)
Deprecated.This will immediately notify the listener of all current sub tables- Specified by:
addSubTableListener
in interfaceITable
- Parameters:
listener
- the listener to notifylocalNotify
- if true then this listener will be notified of all local changes in addition to all remote changes
-
removeTableListener
@Deprecated public void removeTableListener(ITableListener listener)
Deprecated.UseNetworkTable.removeTableListener(int)
instead.Remove a listener from receiving table events- Specified by:
removeTableListener
in interfaceITable
- Parameters:
listener
- the listener to be removed
-
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 interfaceITable
- 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 interfaceITable
- 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 interfaceITable
- 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).
-
getKeys
public Set<String> getKeys()
Deprecated.Gets all keys in the table (not including sub-tables).
-
getSubTables
public Set<String> getSubTables()
Deprecated.Gets the names of all subtables in the table.- Specified by:
getSubTables
in interfaceITable
- Returns:
- subtables currently in the table
-
putNumber
public boolean putNumber(String key, double value)
Deprecated.Put a number in the table
-
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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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.
-
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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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.
-
putBoolean
public boolean putBoolean(String key, boolean value)
Deprecated.Put a boolean in the table- Specified by:
putBoolean
in interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to look updefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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 interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to look updefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to look updefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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 interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to look updefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to look updefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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 interfaceITable
- Parameters:
key
- the key to look updefaultValue
- 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
-
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 interfaceITable
- Parameters:
key
- the keydefaultValue
- 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
-
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.
-
putValue
public boolean putValue(String key, NetworkTableValue value)
Deprecated.Put a value in the table- Parameters:
key
- the key to be assigned tovalue
- 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 keydefaultValue
- 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.UseNetworkTableEntry.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 interfaceITable
- Parameters:
key
- the key to be assigned tovalue
- 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.UseNetworkTableEntry.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, useITable.getDouble(String, double)
.
-
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 interfaceITable
- 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 interfaceITable
- 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 interfaceITable
- 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.
-
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 interfaceITable
- Parameters:
key
- the key nameflags
- the flags to clear (bitmask)
-
getFlags
public int getFlags(String key)
Deprecated.Returns the flags for the specified key.
-
delete
public void delete(String key)
Deprecated.Deletes the specified key in this table. The key can not be null.
-
globalDeleteAll
@Deprecated public static void globalDeleteAll()
Deprecated.UseNetworkTableInstance.deleteAllEntries()
instead.Deletes ALL keys in ALL subtables. Use with caution!
-
flush
@Deprecated public static void flush()
Deprecated.UseNetworkTableInstance.flush()
instead.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.
-
setUpdateRate
@Deprecated public static void setUpdateRate(double interval)
Deprecated.UseNetworkTableInstance.setUpdateRate(double)
instead.Set the periodic update rate.- Parameters:
interval
- update interval in seconds (range 0.01 to 1.0)
-
savePersistent
@Deprecated public static void savePersistent(String filename) throws PersistentException
Deprecated.UseNetworkTableInstance.savePersistent(String)
instead.Saves persistent keys to a file. The server does this automatically.- Parameters:
filename
- file name- Throws:
PersistentException
- if error saving file
-
loadPersistent
@Deprecated public static String[] loadPersistent(String filename) throws PersistentException
Deprecated.UseNetworkTableInstance.loadPersistent(String)
instead.Loads persistent keys from a file. The server does this automatically.- Parameters:
filename
- file name- Returns:
- List of warnings (errors result in an exception instead)
- Throws:
PersistentException
- if error reading file
-
putDouble
@Deprecated public boolean putDouble(String key, double value)
Deprecated.UseputNumber(String, double)
instead.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.
-
getDouble
@Deprecated public double getDouble(String key, double defaultValue)
Deprecated.UsegetNumber(String, double)
instead.Returns the value at the specified key.
-
getPath
public String getPath()
Deprecated.Gets the full path of this table. Does not include the trailing "/".
-
-