device
Class Blobfinder

java.lang.Object
  extended by device.Device
      extended by device.RobotDevice
          extended by device.Blobfinder
All Implemented Interfaces:
IDevice, java.lang.Runnable

public class Blobfinder
extends RobotDevice

A Blobfinder device.


Field Summary
(package private)  java.util.concurrent.CopyOnWriteArrayList<BlobfinderBlob> blobs
          Blob memory
(package private)  int count
          Current blob count in view.
(package private)  java.util.concurrent.CopyOnWriteArrayList<IBlobfinderListener> newBlobListeners
          Callback listeners
 
Fields inherited from class device.RobotDevice
device, deviceNode, logger
 
Fields inherited from class device.Device
deviceList, host, id, index, isRunning, isThreaded, port, sleeptime, thread
 
Fields inherited from interface device.external.IDevice
DEVICE_ACTARRAY_CODE, DEVICE_AIO_CODE, DEVICE_AUDIO_CODE, DEVICE_AUDIODSP_CODE, DEVICE_AUDIOMIXER_CODE, DEVICE_BLINKENLIGHT_CODE, DEVICE_BLOBFINDER_CODE, DEVICE_BUMPER_CODE, DEVICE_CAMERA_CODE, DEVICE_DEVICE_CODE, DEVICE_DIO_CODE, DEVICE_ENERGY_CODE, DEVICE_FIDUCIAL_CODE, DEVICE_GPS_CODE, DEVICE_GRAPHICS2D_CODE, DEVICE_GRAPHICS3D_CODE, DEVICE_GRIPPER_CODE, DEVICE_HEALTH_CODE, DEVICE_IMU_CODE, DEVICE_IR_CODE, DEVICE_JOYSTICK_CODE, DEVICE_LASER_CODE, DEVICE_LIMB_CODE, DEVICE_LOCALIZE_CODE, DEVICE_LOG_CODE, DEVICE_MAP_CODE, DEVICE_MCOM_CODE, DEVICE_NOMAD_CODE, DEVICE_NULL_CODE, DEVICE_OPAQUE_CODE, DEVICE_PLANNER_CODE, DEVICE_POINTCLOUD3D_CODE, DEVICE_POSITION1D_CODE, DEVICE_POSITION2D_CODE, DEVICE_POSITION3D_CODE, DEVICE_POWER_CODE, DEVICE_PTZ_CODE, DEVICE_RANGER_CODE, DEVICE_RFID_CODE, DEVICE_SERVICE_ADV_CODE, DEVICE_SIMULATION_CODE, DEVICE_SONAR_CODE, DEVICE_SOUND_CODE, DEVICE_SPEECH_CODE, DEVICE_SPEECH_RECOGNITION_CODE, DEVICE_TRUTH_CODE, DEVICE_WAVEFORM_CODE, DEVICE_WIFI_CODE, DEVICE_WSN_CODE
 
Constructor Summary
Blobfinder(DeviceNode roboClient, Device device)
          Creates a Blobfinder device object.
 
Method Summary
 boolean addBlobListener(IBlobfinderListener cb)
          Add a new listener to this device.
 java.util.concurrent.CopyOnWriteArrayList<BlobfinderBlob> getBlobs()
           
 int getCount()
           
(package private)  void notifiyListeners(BlobfinderBlob newBlob)
           
 boolean removeBlobListener(IBlobfinderListener cb)
          Remove a listener to this device.
 void shutdown()
          Clear internal structures.
protected  void update()
          Update the current blob count and blob information.
 
Methods inherited from class device.RobotDevice
getDevice, getDeviceNode, getLogger, toString
 
Methods inherited from class device.Device
equals, getDevice, getDeviceIterator, getDeviceList, getDeviceListArray, getHost, getId, getIndex, getPort, getSleepTime, getThreadName, isInList, isRunning, isSupported, isThreaded, matches, matchesList, run, runThreaded, setDeviceList, setHost, setName, setPort, setSleepTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

count

int count
Current blob count in view.


blobs

java.util.concurrent.CopyOnWriteArrayList<BlobfinderBlob> blobs
Blob memory


newBlobListeners

java.util.concurrent.CopyOnWriteArrayList<IBlobfinderListener> newBlobListeners
Callback listeners

Constructor Detail

Blobfinder

public Blobfinder(DeviceNode roboClient,
                  Device device)
Creates a Blobfinder device object.

Parameters:
roboClient - The DeviceNode to which this device is connected.
device - This device' information.
Method Detail

update

protected void update()
Update the current blob count and blob information.

Overrides:
update in class Device

getBlobs

public java.util.concurrent.CopyOnWriteArrayList<BlobfinderBlob> getBlobs()
Returns:
All known blobs to this device since init.

getCount

public int getCount()
Returns:
The current blob count in view.

notifiyListeners

void notifiyListeners(BlobfinderBlob newBlob)

addBlobListener

public boolean addBlobListener(IBlobfinderListener cb)
Add a new listener to this device. The callback is called whenever a new blob is found.

Parameters:
cb - The callback method.
Returns:
CopyOnWriteArrayList.addIfAbsent(Object)

removeBlobListener

public boolean removeBlobListener(IBlobfinderListener cb)
Remove a listener to this device.

Parameters:
cb - The callback method.
Returns:
CopyOnWriteArrayList.remove(Object)

shutdown

public void shutdown()
Clear internal structures.

Specified by:
shutdown in interface IDevice
Overrides:
shutdown in class Device