"

2013 FRC Java API

"

edu.wpi.first.wpilibj.networktables2
Class NetworkTableNode

java.lang.Object
  extended by edu.wpi.first.wpilibj.networktables2.NetworkTableNode
All Implemented Interfaces:
AbstractNetworkTableEntryStore.TableListenerManager, ClientConnectionListenerManager, IRemote
Direct Known Subclasses:
NetworkTableClient, NetworkTableServer

public abstract class NetworkTableNode
extends Object
implements AbstractNetworkTableEntryStore.TableListenerManager, ClientConnectionListenerManager, IRemote

represents a node (either a client or a server) in a network tables 2.0
implementers of the class must ensure that they call #init(NetworkTableTransactionPool, AbstractNetworkTableEntryStore) before calling any other methods on this class

Author:
Mitchell

Field Summary
protected  AbstractNetworkTableEntryStore entryStore
           
 
Constructor Summary
NetworkTableNode()
           
 
Method Summary
 void addConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify)
          Register an object to listen for connection and disconnection events
 void addTableListener(ITableListener listener, boolean immediateNotify)
           
abstract  void close()
          close all networking activity related to this node
 boolean containsKey(String key)
           
 void fireConnectedEvent()
          called when something is connected
 void fireDisconnectedEvent()
          called when something is disconnected
 void fireTableListeners(String key, Object value, boolean isNew)
          Called when the object should fire it's listeners
 boolean getBoolean(String name)
           
 double getDouble(String name)
           
 AbstractNetworkTableEntryStore getEntryStore()
           
 String getString(String name)
           
 Object getValue(String name)
           
protected  void init(AbstractNetworkTableEntryStore entryStore)
           
 void putBoolean(String name, boolean value)
           
 void putComplex(String name, ComplexData value)
           
 void putDouble(String name, double value)
           
 void putString(String name, String value)
           
 void putValue(NetworkTableEntry entry, Object value)
           
 void putValue(String name, NetworkTableEntryType type, Object value)
          Put a value with a specific network table type
 void putValue(String name, Object value)
           
 void removeConnectionListener(IRemoteConnectionListener listener)
          Unregister a listener from connection events
 void removeTableListener(ITableListener listener)
           
 void retrieveValue(String name, Object externalData)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.wpi.first.wpilibj.tables.IRemote
isConnected, isServer
 

Field Detail

entryStore

protected AbstractNetworkTableEntryStore entryStore
Constructor Detail

NetworkTableNode

public NetworkTableNode()
Method Detail

init

protected final void init(AbstractNetworkTableEntryStore entryStore)

getEntryStore

public AbstractNetworkTableEntryStore getEntryStore()
Returns:
the entry store used by this node

putBoolean

public void putBoolean(String name,
                       boolean value)

getBoolean

public boolean getBoolean(String name)
                   throws TableKeyNotDefinedException
Throws:
TableKeyNotDefinedException

putDouble

public void putDouble(String name,
                      double value)

getDouble

public double getDouble(String name)
                 throws TableKeyNotDefinedException
Throws:
TableKeyNotDefinedException

putString

public void putString(String name,
                      String value)

getString

public String getString(String name)
                 throws TableKeyNotDefinedException
Throws:
TableKeyNotDefinedException

putComplex

public void putComplex(String name,
                       ComplexData value)

retrieveValue

public void retrieveValue(String name,
                          Object externalData)
                   throws TableKeyNotDefinedException
Throws:
TableKeyNotDefinedException

putValue

public void putValue(String name,
                     Object value)
              throws IllegalArgumentException
Throws:
IllegalArgumentException

putValue

public void putValue(String name,
                     NetworkTableEntryType type,
                     Object value)
Put a value with a specific network table type

Parameters:
name - the name of the entry to associate with the given value
type - the type of the entry
value - the actual value of the entry

putValue

public void putValue(NetworkTableEntry entry,
                     Object value)

getValue

public Object getValue(String name)
                throws TableKeyNotDefinedException
Throws:
TableKeyNotDefinedException

containsKey

public boolean containsKey(String key)
Parameters:
key - the key to check for existence
Returns:
true if the table has the given key

close

public abstract void close()
close all networking activity related to this node


addConnectionListener

public void addConnectionListener(IRemoteConnectionListener listener,
                                  boolean immediateNotify)
Description copied from interface: IRemote
Register an object to listen for connection and disconnection events

Specified by:
addConnectionListener in interface IRemote
Parameters:
listener - the listener to be register
immediateNotify - if the listener object should be notified of the current connection state

removeConnectionListener

public void removeConnectionListener(IRemoteConnectionListener listener)
Description copied from interface: IRemote
Unregister a listener from connection events

Specified by:
removeConnectionListener in interface IRemote
Parameters:
listener - the listener to be unregistered

fireConnectedEvent

public void fireConnectedEvent()
Description copied from interface: ClientConnectionListenerManager
called when something is connected

Specified by:
fireConnectedEvent in interface ClientConnectionListenerManager

fireDisconnectedEvent

public void fireDisconnectedEvent()
Description copied from interface: ClientConnectionListenerManager
called when something is disconnected

Specified by:
fireDisconnectedEvent in interface ClientConnectionListenerManager

addTableListener

public void addTableListener(ITableListener listener,
                             boolean immediateNotify)

removeTableListener

public void removeTableListener(ITableListener listener)

fireTableListeners

public void fireTableListeners(String key,
                               Object value,
                               boolean isNew)
Description copied from interface: AbstractNetworkTableEntryStore.TableListenerManager
Called when the object should fire it's listeners

Specified by:
fireTableListeners in interface AbstractNetworkTableEntryStore.TableListenerManager

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"