|
2012 FRC Java API |
|||||||||
| 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(String key,
NetworkListener listener)
Adds a NetworkListener to listen to the specified element. |
void |
addListenerToAll(NetworkListener listener)
|
void |
beginTransaction()
Begins a transaction. |
boolean |
containsKey(String key)
Returns whether or not there is a value mapped to the given key |
void |
endTransaction()
|
boolean |
getBoolean(String key)
Returns the value at the specified key. |
boolean |
getBoolean(String key,
boolean defaultValue)
Returns the value at the specified key. |
double |
getDouble(String key)
Returns the value at the specified key. |
double |
getDouble(String key,
double defaultValue)
Returns the value at the specified key. |
int |
getInt(String key)
Returns the value at the specified key. |
int |
getInt(String key,
int defaultValue)
Returns the value at the specified key. |
Vector |
getKeys()
Returns a vector of the keys for this table. |
String |
getString(String key)
Returns the value at the specified key. |
String |
getString(String key,
String defaultValue)
Returns the value at the specified key. |
NetworkTable |
getSubTable(String key)
Returns the value at the specified key. |
static NetworkTable |
getTable(String name)
Returns the table with the given name. |
Object |
getValue(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(String key,
boolean value)
Maps the specified key to the specified value in this table. |
void |
putDouble(String key,
double value)
Maps the specified key to the specified value in this table. |
void |
putInt(String key,
int value)
Maps the specified key to the specified value in this table. |
void |
putString(String key,
String value)
Maps the specified key to the specified value in this table. |
void |
putSubTable(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(String key,
NetworkListener listener)
Removes the given NetworkListener from the specified element. |
void |
removeListenerFromAll(NetworkListener listener)
|
| Methods inherited from class java.lang.Object |
|---|
equals, 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(String name)
name - the name of the table
NoTeamNumberException - if setTeam(...) has not yet been calledpublic void beginTransaction()
public void endTransaction()
public Vector getKeys()
public void putInt(String key,
int value)
key - the keyvalue - the value
IllegalArgumentException - if key is null
public void putBoolean(String key,
boolean value)
key - the keyvalue - the value
IllegalArgumentException - if key is null
public void putDouble(String key,
double value)
key - the keyvalue - the value
IllegalArgumentException - if key is null
public void putString(String key,
String value)
key - the keyvalue - the value
IllegalArgumentException - if key or value is null
public void putSubTable(String key,
NetworkTable value)
key - the keyvalue - the value
IllegalArgumentException - if key or value is null
public void addListener(String key,
NetworkListener listener)
key - the key to listen tolistener - the listenerNetworkListenerpublic void addListenerToAll(NetworkListener listener)
public void removeListener(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 Object getValue(String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the key is null
public int getInt(String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not an int
IllegalArgumentException - if the key is null
public double getDouble(String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not a double
IllegalArgumentException - if the key is null
public String getString(String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not a string
IllegalArgumentException - if the key is null
public NetworkTable getSubTable(String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not a string
IllegalArgumentException - if the key is null
public boolean getBoolean(String key)
throws NetworkTableKeyNotDefined
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not a boolean
IllegalArgumentException - if the key is null
public int getInt(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
IllegalArgumentException - if the value mapped to by the key is not an int
IllegalArgumentException - if the key is null
public double getDouble(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
IllegalArgumentException - if the value mapped to by the key is not a double
IllegalArgumentException - if the key is null
public String getString(String key,
String defaultValue)
key - the keydefaultValue - the value returned if the key is undefined
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not a string
IllegalArgumentException - if the key is null
public boolean getBoolean(String key,
boolean defaultValue)
key - the key
NetworkTableKeyNotDefined - if there is no value mapped to by the key
IllegalArgumentException - if the value mapped to by the key is not a boolean
IllegalArgumentException - if the key is nullpublic boolean isConnected()
public boolean containsKey(String key)
key - the key
|
2012 FRC Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||