cork.device
Class AbstractDevice

java.lang.Object
  |
  +--cork.device.AbstractDevice
All Implemented Interfaces:
Device
Direct Known Subclasses:
AbstractI2CDevice

public abstract class AbstractDevice
extends java.lang.Object
implements Device

All devices should use this base class.

Version:
0.1.0
Author:
Brill Pappin

Constructor Summary
AbstractDevice()
          Constructor for the AbstractDevice object
 
Method Summary
 void addEventListener(DeviceEventListener listener)
          This is a convenience method to allow a listener to add itself to the event queue in order to be notified of an event.
 void removeEventListener(DeviceEventListener listener)
          This is a convenience method to allow listener to remove itself from the event queue so that it no longer receives events.
protected  void sendDeviceEvent(DeviceEvent event)
          This method sends an event out to all classes who are listening for events in the VM.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cork.device.Device
getDeviceDestription, getDeviceName
 

Constructor Detail

AbstractDevice

public AbstractDevice()
Constructor for the AbstractDevice object
Since:
0.1.0
Method Detail

sendDeviceEvent

protected final void sendDeviceEvent(DeviceEvent event)
This method sends an event out to all classes who are listening for events in the VM. The listeners will identify their interest in the sent event by checking the instance of the sending class, or by code or message.
Parameters:
event - Description of Parameter
Since:
0.1.0

addEventListener

public final void addEventListener(DeviceEventListener listener)
This is a convenience method to allow a listener to add itself to the event queue in order to be notified of an event.
Parameters:
listener - cork.event.DeviceEventListener The listener to be added.
Since:
0.1.0

removeEventListener

public final void removeEventListener(DeviceEventListener listener)
This is a convenience method to allow listener to remove itself from the event queue so that it no longer receives events.
Parameters:
listener - cork.event.DeviceEventListener The listener to be removed.
Since:
0.1.0