"

2013 FRC Java API

"

edu.wpi.first.wpilibj.networktables2
Class AbstractNetworkTableEntryStore

java.lang.Object
  extended by edu.wpi.first.wpilibj.networktables2.AbstractNetworkTableEntryStore
All Implemented Interfaces:
IncomingEntryReceiver
Direct Known Subclasses:
ClientNetworkTableEntryStore, ServerNetworkTableEntryStore

public abstract class AbstractNetworkTableEntryStore
extends Object
implements IncomingEntryReceiver

An entry store that handles storing entries and applying transactions

Author:
mwills, Fredric

Nested Class Summary
static interface AbstractNetworkTableEntryStore.TableListenerManager
          An object that handles firing Table Listeners
 
Field Summary
protected  CharacterArrayMap idEntries
           
protected  OutgoingEntryReceiver incomingReceiver
           
protected  AbstractNetworkTableEntryStore.TableListenerManager listenerManager
           
protected  Hashtable namedEntries
           
protected  OutgoingEntryReceiver outgoingReceiver
           
 
Fields inherited from interface edu.wpi.first.wpilibj.networktables2.IncomingEntryReceiver
NULL
 
Constructor Summary
protected AbstractNetworkTableEntryStore(AbstractNetworkTableEntryStore.TableListenerManager listenerManager)
           
 
Method Summary
protected abstract  boolean addEntry(NetworkTableEntry entry)
           
 void clearEntries()
          Remove all entries NOTE: This method should not be used with applications which cache entries which would lead to unknown results This method is for use in testing only
 void clearIds()
          clear the id's of all entries
 NetworkTableEntry getEntry(char entryId)
          Get an entry based on it's id
 NetworkTableEntry getEntry(String name)
          Get an entry based on it's name
 List keys()
          Get an entry based on it's name
 void notifyEntries(ITable table, ITableListener listener)
          Called to say that a listener should notify the listener manager of all of the entries
 void offerIncomingAssignment(NetworkTableEntry entry)
           
 void offerIncomingUpdate(NetworkTableEntry entry, char sequenceNumber, Object value)
           
 void putOutgoing(NetworkTableEntry tableEntry, Object value)
           
 void putOutgoing(String name, NetworkTableEntryType type, Object value)
          Stores the given value under the given name and queues it for transmission to the server.
 void setIncomingReceiver(OutgoingEntryReceiver receiver)
           
 void setOutgoingReceiver(OutgoingEntryReceiver receiver)
           
protected abstract  boolean updateEntry(NetworkTableEntry entry, char sequenceNumber, Object value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idEntries

protected final CharacterArrayMap idEntries

namedEntries

protected final Hashtable namedEntries

listenerManager

protected final AbstractNetworkTableEntryStore.TableListenerManager listenerManager

outgoingReceiver

protected OutgoingEntryReceiver outgoingReceiver

incomingReceiver

protected OutgoingEntryReceiver incomingReceiver
Constructor Detail

AbstractNetworkTableEntryStore

protected AbstractNetworkTableEntryStore(AbstractNetworkTableEntryStore.TableListenerManager listenerManager)
Method Detail

getEntry

public NetworkTableEntry getEntry(char entryId)
Get an entry based on it's id

Parameters:
entryId - the id f the entry to look for
Returns:
the entry or null if the entry does not exist

getEntry

public NetworkTableEntry getEntry(String name)
Get an entry based on it's name

Parameters:
name - the name of the entry to look for
Returns:
the entry or null if the entry does not exist

keys

public List keys()
Get an entry based on it's name

Parameters:
name - the name of the entry to look for
Returns:
the entry or null if the entry does not exist

clearEntries

public void clearEntries()
Remove all entries NOTE: This method should not be used with applications which cache entries which would lead to unknown results This method is for use in testing only


clearIds

public void clearIds()
clear the id's of all entries


setOutgoingReceiver

public void setOutgoingReceiver(OutgoingEntryReceiver receiver)

setIncomingReceiver

public void setIncomingReceiver(OutgoingEntryReceiver receiver)

addEntry

protected abstract boolean addEntry(NetworkTableEntry entry)

updateEntry

protected abstract boolean updateEntry(NetworkTableEntry entry,
                                       char sequenceNumber,
                                       Object value)

putOutgoing

public void putOutgoing(String name,
                        NetworkTableEntryType type,
                        Object value)
                 throws TableKeyExistsWithDifferentTypeException
Stores the given value under the given name and queues it for transmission to the server.

Parameters:
name - The name under which to store the given value.
type - The type of the given value.
value - The value to store.
Throws:
TableKeyExistsWithDifferentTypeException - Thrown if an entry already exists with the given name and is of a different type.

putOutgoing

public void putOutgoing(NetworkTableEntry tableEntry,
                        Object value)

offerIncomingAssignment

public void offerIncomingAssignment(NetworkTableEntry entry)
Specified by:
offerIncomingAssignment in interface IncomingEntryReceiver

offerIncomingUpdate

public void offerIncomingUpdate(NetworkTableEntry entry,
                                char sequenceNumber,
                                Object value)
Specified by:
offerIncomingUpdate in interface IncomingEntryReceiver

notifyEntries

public void notifyEntries(ITable table,
                          ITableListener listener)
Called to say that a listener should notify the listener manager of all of the entries

Parameters:
listener -
table -

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"