edu.wpi.first.wpilibj.networktables
Class NetworkTableKeyListenerAdapter

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

public class NetworkTableKeyListenerAdapter
extends Object
implements ITableListener

An adapter that is used to filter value change notifications for a specific key

Author:
Mitchell

Constructor Summary
NetworkTableKeyListenerAdapter(String relativeKey, String fullKey, NetworkTable 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

NetworkTableKeyListenerAdapter

public NetworkTableKeyListenerAdapter(String relativeKey,
                                      String fullKey,
                                      NetworkTable targetSource,
                                      ITableListener targetListener)
Create a new adapter

Parameters:
relativeKey - the name of the key relative to the table (this is what the listener will receiver as the key)
fullKey - the full name of the key in the NetworkTableNode
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.