adm.event
Class CAdaptor

java.lang.Object
  |
  +--adm.event.CAdaptor

public class CAdaptor
extends java.lang.Object
implements CInterface, DeviceListener

CAdaptor is an invisible bean used to monitor and to control a cdev Device Property's value.
A cdev.DeviceListener can subscribe to this bean to receive notification of monitors. Objects can also send CDEV "set" commands via this bean. Currently the data type to set is restricted to int, double or String.

Since:
adm0.1

Constructor Summary
CAdaptor()
           
 
Method Summary
 void addDeviceListener(DeviceListener dl)
          Add the device listener
 void deviceChanged(DeviceEvent evt)
           
 java.lang.String getDeviceName()
          Return the device name to which this component is connected.
 java.lang.String getPropertyName()
          Return the device property name to which this component is connected.
 java.lang.String getStringValue()
          Return the data value as a string
 void removeDeviceListener(DeviceListener dl)
          Remove the device listener
 void setDeviceName(java.lang.String newName)
          Set the Device name
 void setPropertyName(java.lang.String newName)
          Set device property name
 void setValue(double val)
          Send a double data to control system
 void setValue(int val)
          Send a int data to control system
 void setValue(java.lang.String val)
          Send a String data to control system
 java.lang.String toString()
          Return device name.property name as a string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CAdaptor

public CAdaptor()
Method Detail

setDeviceName

public void setDeviceName(java.lang.String newName)
Set the Device name
Specified by:
setDeviceName in interface CInterface
Parameters:
newName - the name of device you want to connect

getDeviceName

public java.lang.String getDeviceName()
Return the device name to which this component is connected. If device name is not set, return empty string "".
Specified by:
getDeviceName in interface CInterface

setPropertyName

public void setPropertyName(java.lang.String newName)
Set device property name
Specified by:
setPropertyName in interface CInterface
Parameters:
newName - the name of device property you want to connect

getPropertyName

public java.lang.String getPropertyName()
Return the device property name to which this component is connected. If property name is not set, return empty string "".
Specified by:
getPropertyName in interface CInterface

addDeviceListener

public void addDeviceListener(DeviceListener dl)
Add the device listener

removeDeviceListener

public void removeDeviceListener(DeviceListener dl)
Remove the device listener

toString

public java.lang.String toString()
Return device name.property name as a string
Overrides:
toString in class java.lang.Object

deviceChanged

public void deviceChanged(DeviceEvent evt)
Specified by:
deviceChanged in interface DeviceListener

getStringValue

public java.lang.String getStringValue()
Return the data value as a string

setValue

public void setValue(java.lang.String val)
Send a String data to control system

setValue

public void setValue(double val)
Send a double data to control system

setValue

public void setValue(int val)
Send a int data to control system