|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.wpi.first.wpilibj.networktables.NetworkTable
public class NetworkTable
| Constructor Summary | |
|---|---|
NetworkTable()
Creates a new NetworkTable. |
|
| Method Summary | |
|---|---|
void |
addAdditionListener(NetworkAdditionListener listener)
Adds the NetworkAdditionListener to the table. |
void |
addConnectionListener(NetworkConnectionListener listener,
boolean immediateNotify)
Adds a NetworkConnectionListener to this table. |
void |
addListener(java.lang.String key,
NetworkListener listener)
Adds a NetworkListener to listen to the specified element. |
void |
addListenerToAll(NetworkListener listener)
|
void |
beginTransaction()
Begins a transaction. |
boolean |
containsKey(java.lang.String key)
Returns whether or not there is a value mapped to the given key |
void |
endTransaction()
|
boolean |
getBoolean(java.lang.String key)
Returns the value at the specified key. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Returns the value at the specified key. |
double |
getDouble(java.lang.String key)
Returns the value at the specified key. |
double |
getDouble(java.lang.String key,
double defaultValue)
Returns the value at the specified key. |
int |
getInt(java.lang.String key)
Returns the value at the specified key. |
int |
getInt(java.lang.String key,
int defaultValue)
Returns the value at the specified key. |
java.util.Vector |
getKeys()
Returns a vector of the keys for this table. |
java.lang.String |
getString(java.lang.String key)
Returns the value at the specified key. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Returns the value at the specified key. |
NetworkTable |
getSubTable(java.lang.String key)
Returns the value at the specified key. |
static NetworkTable |
getTable(java.lang.String name)
Returns the table with the given name. |
java.lang.Object |
getValue(java.lang.String key)
Returns the value at the specified key. |
static void |
initialize()
Opens up the connection stream. |
boolean |
isConnected()
Returns whether or not this table is connected to the robot. |
void |
putBoolean(java.lang.String key,
boolean value)
Maps the specified key to the specified value in this table. |
void |
putDouble(java.lang.String key,
double value)
Maps the specified key to the specified value in this table. |
void |
putInt(java.lang.String key,
int value)
Maps the specified key to the specified value in this table. |
void |
putString(java.lang.String key,
java.lang.String value)
Maps the specified key to the specified value in this table. |
void |
putSubTable(java.lang.String key,
NetworkTable value)
Maps the specified key to the specified value in this table. |
void |
removeAdditionListener(NetworkAdditionListener listener)
Removes the given NetworkAdditionListener from the set of listeners. |
void |
removeConnectionListener(NetworkConnectionListener listener)
Removes the given NetworkConnectionListener from the table. |
void |
removeListener(java.lang.String key,
NetworkListener listener)
Removes the given NetworkListener from the specified element. |
void |
removeListenerFromAll(NetworkListener listener)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NetworkTable()
| Method Detail |
|---|
public static void initialize()
getTable(java.lang.String) is
called. This will only have an effect the first time this is called.
public static NetworkTable getTable(java.lang.String name)
name - the name of the table
NoTeamNumberException - if setTeam(...) has not yet been calledpublic void beginTransaction()
public void endTransaction()
public java.util.Vector getKeys()
public void putInt(java.lang.String key,
int value)
key - the keyvalue - the value
java.lang.IllegalArgumentException - if key is null
public void putBoolean(java.lang.String key,
boolean value)
key - the keyvalue - the value
java.lang.IllegalArgumentException - if key is null
public void putDouble(java.lang.String key,
double value)
key - the keyvalue - the value
java.lang.IllegalArgumentException - if key is null
public void putString(java.lang.String key,
java.lang.String value)
key - the keyvalue - the value
java.lang.IllegalArgumentException - if key or value is null
public void putSubTable(java.lang.String key,
NetworkTable value)
key - the keyvalue - the value
java.lang.IllegalArgumentException - if key or value is null
public void addListener(java.lang.String key,
NetworkListener listener)
key - the key to listen tolistener - the listenerNetworkListenerpublic void addListenerToAll(NetworkListener listener)
public void removeListener(java.lang.String key,
NetworkListener listener)
key - the key to no longer listen to (or NetworkTable.ALL).listener - the listener to removeNetworkListenerpublic void removeListenerFromAll(NetworkListener listener)
public void addAdditionListener(NetworkAdditionListener listener)
listener - the listener to addNetworkAdditionListenerpublic void removeAdditionListener(NetworkAdditionListener listener)
listener - the listener to removeNetworkAdditionListener
public void addConnectionListener(NetworkConnectionListener listener,
boolean immediateNotify)
listener - the listener to addimmediateNotify - whether to tell the listener of the current connection statusNetworkConnectionListenerpublic void removeConnectionListener(NetworkConnectionListener listener)
listener - the listener to removeNetworkConnectionListener
public java.lang.Object getValue(java.lang.String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the key is null
public int getInt(java.lang.String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not an int
java.lang.IllegalArgumentException - if the key is null
public double getDouble(java.lang.String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a double
java.lang.IllegalArgumentException - if the key is null
public java.lang.String getString(java.lang.String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a string
java.lang.IllegalArgumentException - if the key is null
public NetworkTable getSubTable(java.lang.String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a string
java.lang.IllegalArgumentException - if the key is null
public boolean getBoolean(java.lang.String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a boolean
java.lang.IllegalArgumentException - if the key is null
public int getInt(java.lang.String key,
int defaultValue)
key - the keydefaultValue - The value returned if the key is undefined
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not an int
java.lang.IllegalArgumentException - if the key is null
public double getDouble(java.lang.String key,
double defaultValue)
key - the keydefaultValue - the value returned if the key is undefined
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a double
java.lang.IllegalArgumentException - if the key is null
public java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
key - the keydefaultValue - the value returned if the key is undefined
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a string
java.lang.IllegalArgumentException - if the key is null
public boolean getBoolean(java.lang.String key,
boolean defaultValue)
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a boolean
java.lang.IllegalArgumentException - if the key is nullpublic boolean isConnected()
public boolean containsKey(java.lang.String key)
key - the key
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||