edu.wpi.first.networktables

## Class NetworkTable

- java.lang.Object
- - edu.wpi.first.networktables.NetworkTable

-     public final class NetworkTable
      extends java.lang.Object

  A network table that knows its subtable path.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static char` | `PATH_SEPARATOR` The path separator for sub-tables and keys

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetworkTable(NetworkTableInstance inst, java.lang.String path)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addEntryListener(java.lang.String key, TableEntryListener listener, int flags)` Listen to a single key.
    `int` | `addEntryListener(TableEntryListener listener, int flags)` Listen to keys only within this table.
    `int` | `addSubTableListener(TableListener listener, boolean localNotify)` Listen for sub-table creation.
    `boolean` | `containsKey(java.lang.String key)` Checks the table and tells if it contains the specified key
    `boolean` | `containsSubTable(java.lang.String key)`
    `void` | `delete(java.lang.String key)` Deletes the specified key in this table.
    `boolean` | `equals(java.lang.Object o)`
    `NetworkTableEntry` | `getEntry(java.lang.String key)` Gets the entry for a subkey.
    `NetworkTableInstance` | `getInstance()` Gets the instance for the table.
    `java.util.Set<java.lang.String>` | `getKeys()` Gets all keys in the table (not including sub-tables).
    `java.util.Set<java.lang.String>` | `getKeys(int types)` Gets all keys in the table (not including sub-tables).
    `java.lang.String` | `getPath()`
    `NetworkTable` | `getSubTable(java.lang.String key)` Returns the table at the specified key.
    `java.util.Set<java.lang.String>` | `getSubTables()` Gets the names of all subtables in the table.
    `int` | `hashCode()`
    `java.lang.String[]` | `loadEntries(java.lang.String filename)` Load table values from a file.
    `void` | `removeEntryListener(int listener)` Remove an entry listener.
    `void` | `removeTableListener(int listener)` Remove a sub-table listener.
    `void` | `saveEntries(java.lang.String filename)` Save table values to a file.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### PATH_SEPARATOR

          public static final char PATH_SEPARATOR

      The path separator for sub-tables and keys
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NetworkTable

          public NetworkTable(NetworkTableInstance inst,
                              java.lang.String path)

  - ### Method Detail

    - #### getInstance

          public NetworkTableInstance getInstance()

      Gets the instance for the table.
      Returns:
        Instance

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getEntry

          public NetworkTableEntry getEntry(java.lang.String key)

      Gets the entry for a subkey.
      Parameters:
        `key` - the key name
      Returns:
        Network table entry.

    - #### addEntryListener

          public int addEntryListener(TableEntryListener listener,
                                      int flags)

      Listen to keys only within this table.
      Parameters:
        `listener` - listener to add
        `flags` - `EntryListenerFlags` bitmask
      Returns:
        Listener handle

    - #### addEntryListener

          public int addEntryListener(java.lang.String key,
                                      TableEntryListener listener,
                                      int flags)

      Listen to a single key.
      Parameters:
        `key` - the key name
        `listener` - listener to add
        `flags` - `EntryListenerFlags` bitmask
      Returns:
        Listener handle

    - #### removeEntryListener

          public void removeEntryListener(int listener)

      Remove an entry listener.
      Parameters:
        `listener` - listener handle

    - #### addSubTableListener

          public int addSubTableListener(TableListener listener,
                                         boolean localNotify)

      Listen for sub-table creation. This calls the listener once for each newly created sub-table. It immediately calls the listener for any existing sub-tables.
      Parameters:
        `listener` - listener to add
        `localNotify` - notify local changes as well as remote
      Returns:
        Listener handle

    - #### removeTableListener

          public void removeTableListener(int listener)

      Remove a sub-table listener.
      Parameters:
        `listener` - listener handle

    - #### getSubTable

          public NetworkTable getSubTable(java.lang.String key)

      Returns the table at the specified key. If there is no table at the specified key, it will create a new table
      Parameters:
        `key` - the name of the table relative to this one
      Returns:
        a sub table relative to this one

    - #### containsKey

          public boolean containsKey(java.lang.String key)

      Checks the table and tells if it contains the specified key
      Parameters:
        `key` - the key to search for
      Returns:
        true if the table as a value assigned to the given key

    - #### containsSubTable

          public boolean containsSubTable(java.lang.String key)

      Parameters:
        `key` - the key to search for
      Returns:
        true if there is a subtable with the key which contains at least one key/subtable of its own

    - #### getKeys

          public java.util.Set<java.lang.String> getKeys(int types)

      Gets all keys in the table (not including sub-tables).
      Parameters:
        `types` - bitmask of types; 0 is treated as a "don't care".
      Returns:
        keys currently in the table

    - #### getKeys

          public java.util.Set<java.lang.String> getKeys()

      Gets all keys in the table (not including sub-tables).
      Returns:
        keys currently in the table

    - #### getSubTables

          public java.util.Set<java.lang.String> getSubTables()

      Gets the names of all subtables in the table.
      Returns:
        subtables currently in the table

    - #### delete

          public void delete(java.lang.String key)

      Deletes the specified key in this table. The key can not be null.
      Parameters:
        `key` - the key name

    - #### getPath

          public java.lang.String getPath()

    - #### saveEntries

          public void saveEntries(java.lang.String filename)
                           throws PersistentException

      Save table values to a file. The file format used is identical to that used for SavePersistent.
      Parameters:
        `filename` - filename
      Throws:
        `PersistentException` - if error saving file

    - #### loadEntries

          public java.lang.String[] loadEntries(java.lang.String filename)
                                         throws PersistentException

      Load table values from a file. The file format used is identical to that used for SavePersistent / LoadPersistent.
      Parameters:
        `filename` - filename
      Returns:
        List of warnings (errors result in an exception instead)
      Throws:
        `PersistentException` - if error saving file

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`