edu.wpi.first.wpilibj.networktables
Class NetworkTableListenerAdapter

java.lang.Object
  extended by edu.wpi.first.wpilibj.networktables.NetworkTableListenerAdapter
All Implemented Interfaces:
ITableListener

public class NetworkTableListenerAdapter
extends Object
implements ITableListener

An adapter that is used to filter value change notifications and make the path relative to the NetworkTable

Author:
Mitchell

Constructor Summary
NetworkTableListenerAdapter(String prefix, ITable targetSource, ITableListener targetListener)
          Create a new adapter
 
Method Summary
 void valueChanged(ITable source, String key, Object value, boolean isNew)
          Called when a key-value pair is changed in a ITable WARNING: If a new key-value is put in this method value changed will immediatly be called which could lead to recursive code
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkTableListenerAdapter

public NetworkTableListenerAdapter(String prefix,
                                   ITable targetSource,
                                   ITableListener targetListener)
Create a new adapter

Parameters:
prefix - the prefix that will be filtered/removed from the beginning of the key
targetSource - the source that events passed to the target listener will appear to come from
targetListener - the listener where events are forwarded to
Method Detail

valueChanged

public void valueChanged(ITable source,
                         String key,
                         Object value,
                         boolean isNew)
Description copied from interface: ITableListener
Called when a key-value pair is changed in a ITable WARNING: If a new key-value is put in this method value changed will immediatly be called which could lead to recursive code

Specified by:
valueChanged in interface ITableListener
Parameters:
source - the table the key-value pair exists in
key - the key associated with the value that changed
value - the new value
isNew - true if the key did not previously exist in the table, otherwise it is false


Copyright © 2013. All rights reserved.