"

2013 FRC Java API

"

edu.wpi.first.wpilibj.networktables2
Class NetworkTableEntry

java.lang.Object
  extended by edu.wpi.first.wpilibj.networktables2.NetworkTableEntry

public class NetworkTableEntry
extends Object

An entry in a network table

Author:
mwills

Field Summary
 String name
          the name of the entry
static char UNKNOWN_ID
          the id that represents that an id is unknown for an entry
 
Constructor Summary
NetworkTableEntry(char id, String name, char sequenceNumber, NetworkTableEntryType type, Object value)
          Create a new entry with the given id, name, sequence number, type and value
NetworkTableEntry(String name, NetworkTableEntryType type, Object value)
          Create a new entry with the given name, type, value, an unknown id and a sequence number of 0
 
Method Summary
 void clearId()
          clear the id of the entry to unknown
 void fireListener(AbstractNetworkTableEntryStore.TableListenerManager listenerManager)
           
 void forcePut(char newSequenceNumber, NetworkTableEntryType type, Object newValue)
          force a value and new sequence number upon an entry, Will also set the type of the entry
 void forcePut(char newSequenceNumber, Object newValue)
          force a value and new sequence number upon an entry
 char getId()
           
 char getSequenceNumber()
           
 NetworkTableEntryType getType()
           
 Object getValue()
           
 boolean isDirty()
           
 void makeClean()
           
 void makeDirty()
           
 boolean putValue(char newSequenceNumber, Object newValue)
          set the value of the entry if the given sequence number is greater that the current sequence number
 void send(NetworkTableConnection connection)
           
 void sendValue(DataOutputStream os)
          Send the value of the entry over the output stream
 void setId(char id)
          Sets the id of the entry
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_ID

public static final char UNKNOWN_ID
the id that represents that an id is unknown for an entry

See Also:
Constant Field Values

name

public final String name
the name of the entry

Constructor Detail

NetworkTableEntry

public NetworkTableEntry(String name,
                         NetworkTableEntryType type,
                         Object value)
Create a new entry with the given name, type, value, an unknown id and a sequence number of 0

Parameters:
name -
type -
value -

NetworkTableEntry

public NetworkTableEntry(char id,
                         String name,
                         char sequenceNumber,
                         NetworkTableEntryType type,
                         Object value)
Create a new entry with the given id, name, sequence number, type and value

Parameters:
id -
name -
sequenceNumber -
type -
value -
Method Detail

getId

public char getId()
Returns:
the id of the entry

getValue

public Object getValue()
Returns:
the current value of the entry

getType

public NetworkTableEntryType getType()
Returns:
the type of the entry

putValue

public boolean putValue(char newSequenceNumber,
                        Object newValue)
set the value of the entry if the given sequence number is greater that the current sequence number

Parameters:
newSequenceNumber - the sequence number of the incoming entry
newValue - the new value
Returns:
true if the value was set

forcePut

public void forcePut(char newSequenceNumber,
                     Object newValue)
force a value and new sequence number upon an entry

Parameters:
newSequenceNumber -
newValue -

forcePut

public void forcePut(char newSequenceNumber,
                     NetworkTableEntryType type,
                     Object newValue)
force a value and new sequence number upon an entry, Will also set the type of the entry

Parameters:
newSequenceNumber -
type -
newValue -

makeDirty

public void makeDirty()

makeClean

public void makeClean()

isDirty

public boolean isDirty()

sendValue

public void sendValue(DataOutputStream os)
               throws IOException
Send the value of the entry over the output stream

Parameters:
os -
Throws:
IOException

getSequenceNumber

public char getSequenceNumber()
Returns:
the current sequence number of the entry

setId

public void setId(char id)
           throws IllegalStateException
Sets the id of the entry

Parameters:
id - the id of the entry
Throws:
IllegalStateException - if the entry already has a known id

clearId

public void clearId()
clear the id of the entry to unknown


send

public void send(NetworkTableConnection connection)
          throws IOException
Throws:
IOException

fireListener

public void fireListener(AbstractNetworkTableEntryStore.TableListenerManager listenerManager)

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Object
Returns:
a string representation of the object.

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"