| Modifier and Type | Class and Description |
|---|---|
private class |
NetworkTable.EntryCache |
(package private) static class |
NetworkTable.NetworkTableKeyCache |
| Modifier and Type | Field and Description |
|---|---|
private NetworkTable.NetworkTableKeyCache |
m_absoluteKeyCache |
private NetworkTable.EntryCache |
m_entryCache |
private java.util.Hashtable<ITableListener,java.util.List<ITableListener>> |
m_listenerMap |
private java.lang.String |
m_path |
private static NTServerTableProvider |
m_provider |
private static NTServer |
m_server |
static char |
PATH_SEPARATOR
The path separator for sub-tables and keys
|
| Constructor and Description |
|---|
NetworkTable(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubTableListener(ITableListener listener)
This will immediately notify the listener of all current sub tables
|
void |
addTableListener(ITableListener listener)
Add a listener for changes to the table
|
void |
addTableListener(ITableListener listener,
boolean immediateNotify)
Add a listener for changes to the table
|
void |
addTableListener(java.lang.String key,
ITableListener listener,
boolean immediateNotify)
Add a listener for changes to a specific key the table
|
private static void |
checkInit() |
boolean |
containsKey(java.lang.String key)
Checks the table and tells if it contains the specified key
|
boolean |
containsSubTable(java.lang.String key) |
boolean |
getBoolean(java.lang.String key)
Returns the key that the name maps to.
|
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Returns the key that the name maps to.
|
private NTTableEntry |
getEntry(java.lang.String key) |
double |
getNumber(java.lang.String key)
Returns the key that the name maps to.
|
double |
getNumber(java.lang.String key,
double defaultValue)
Returns the key that the name maps to.
|
java.lang.String |
getString(java.lang.String key)
Returns the key that the name maps to.
|
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Returns the key that the name maps to.
|
ITable |
getSubTable(java.lang.String key)
Returns the table at the specified key.
|
static ITable |
getTable(java.lang.String key)
Gets the table with the specified key.
|
java.lang.Object |
getValue(java.lang.String key)
Returns the key that the name maps to.
|
java.lang.Object |
getValue(java.lang.String key,
java.lang.Object defaultValue)
Returns the key that the name maps to.
|
static void |
initialize() |
boolean |
isConnected() |
boolean |
isServer() |
void |
putBoolean(java.lang.String key,
boolean value)
Maps the specified key to the specified value in this table.
|
void |
putNumber(java.lang.String key,
double 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 |
putValue(java.lang.String key,
java.lang.Object value)
Maps the specified key to the specified value in this table.
|
void |
removeTableListener(ITableListener listener)
Remove a listener from receiving table events
|
void |
retrieveValue(java.lang.String key,
java.lang.Object externalValue) |
java.lang.String |
toString() |
public static final char PATH_SEPARATOR
private static NTServerTableProvider m_provider
private static NTServer m_server
private final java.lang.String m_path
private final NetworkTable.EntryCache m_entryCache
private final NetworkTable.NetworkTableKeyCache m_absoluteKeyCache
private final java.util.Hashtable<ITableListener,java.util.List<ITableListener>> m_listenerMap
private static void checkInit()
public static void initialize()
throws java.io.IOException
java.io.IOExceptionpublic static ITable getTable(java.lang.String key)
key - the key namepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isConnected()
public boolean isServer()
public void addTableListener(ITableListener listener)
ITableaddTableListener in interface ITablelistener - the listener to addpublic void addTableListener(ITableListener listener, boolean immediateNotify)
ITableaddTableListener in interface ITablelistener - the listener to addimmediateNotify - if true then this listener will be notified of all current entries (marked as new)public void addTableListener(java.lang.String key,
ITableListener listener,
boolean immediateNotify)
ITableaddTableListener in interface ITablekey - the key to listen forlistener - the listener to addimmediateNotify - if true then this listener will be notified of all current entries (marked as new)public void addSubTableListener(ITableListener listener)
ITableaddSubTableListener in interface ITablepublic void removeTableListener(ITableListener listener)
ITableremoveTableListener in interface ITablelistener - the listener to be removedprivate NTTableEntry getEntry(java.lang.String key)
public ITable getSubTable(java.lang.String key)
getSubTable in interface ITablekey - the key namepublic boolean containsKey(java.lang.String key)
containsKey in interface ITablekey - the key to be checkedpublic boolean containsSubTable(java.lang.String key)
containsSubTable in interface ITablekey - the key to search forpublic void putNumber(java.lang.String key,
double value)
public double getNumber(java.lang.String key)
throws java.util.NoSuchElementException
public double getNumber(java.lang.String key,
double defaultValue)
public void putString(java.lang.String key,
java.lang.String value)
public java.lang.String getString(java.lang.String key)
throws java.util.NoSuchElementException
public java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
public void putBoolean(java.lang.String key,
boolean value)
putBoolean in interface ITablekey - the keyvalue - the valuepublic boolean getBoolean(java.lang.String key)
throws java.util.NoSuchElementException
getBoolean in interface ITablekey - the key namejava.util.NoSuchElementException - if the specified key is nullpublic boolean getBoolean(java.lang.String key,
boolean defaultValue)
getBoolean in interface ITablekey - the key namedefaultValue - the default value if the key is nullpublic void retrieveValue(java.lang.String key,
java.lang.Object externalValue)
retrieveValue in interface ITablepublic void putValue(java.lang.String key,
java.lang.Object value)
public java.lang.Object getValue(java.lang.String key)
throws java.util.NoSuchElementException
public java.lang.Object getValue(java.lang.String key,
java.lang.Object defaultValue)
key - the key namedefaultValue - the default value if the key is null