cdev
Class DeviceArray

java.lang.Object
  |
  +--cdev.Device
        |
        +--cdev.DeviceArray

public class DeviceArray
extends Device

This class provides an ordered collection of devices represented by a Device object. It overwrites the I/O methods. The data objects referred in I/O methods and in DeviceEvent include the values for all the single devices. As a result, the "value" dataEntry will have as its first dimension the size of the collection.

Since:
JDK1.1

Fields inherited from class cdev.Device
CONTROL_CTX, MONITOR_CTX, VALUE_CTX
 
Constructor Summary
DeviceArray(java.lang.String listName)
          Constructs a device array from a pre-defined list.
DeviceArray(java.lang.String listName, ControlSystem controlSystem)
          Constructs a device array from a pre-defined list.
DeviceArray(java.lang.String name, java.lang.String[] names)
          Constructs a device array from a dynamic list.
DeviceArray(java.lang.String name, java.lang.String[] names, ControlSystem controlSystem)
          Constructs a device array from a dynamic list.
 
Method Summary
 DeviceClass getDeviceClass()
          Returns the reference to the device class this device belongs to.
 DeviceData[] getDeviceDatas()
          Returns the array of DeviceData
 Device[] getDevices()
          Returns component as independant devices.
 java.lang.String[] getNames()
          Returns the names of the components in this device array.
 boolean needCycleType()
          Returns true if the I/O may require a cycle type.
 int size()
          Returns the number of components in this device array.
 
Methods inherited from class cdev.Device
get, get, getCharacteristic, getCharacteristic, getContext, getControlSystem, getName, getReference, getReference, getServiceData, monitorOff, monitorOn, needCycleType, send, send, send, sendNoBlock, set, set, setContext, setContext, setReference, setReference, setServiceData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceArray

public DeviceArray(java.lang.String listName,
                   ControlSystem controlSystem)
            throws DataNotFoundException,
                   java.io.IOException
Constructs a device array from a pre-defined list. The list must be defined into the directory service.
Parameters:
listName - a name of a list of devices.
controlSystem - the control system that will manage the I/O for this device, null means the default control system.
Throws:
DataNotFoundException - if the list id not found in the directory service.

DeviceArray

public DeviceArray(java.lang.String listName)
            throws DataNotFoundException,
                   java.io.IOException
Constructs a device array from a pre-defined list. Use the default control system. Doc to be completed.
See Also:
DeviceArray(String,ControlSystem)

DeviceArray

public DeviceArray(java.lang.String name,
                   java.lang.String[] names,
                   ControlSystem controlSystem)
            throws DataNotFoundException,
                   java.io.IOException
Constructs a device array from a dynamic list.
Parameters:
name - the name for the array device
names - the names of the devices that compose the array.
controlSystem - the control system that will manage the I/O for this device, null means the default control system.
Throws:
DataNotFoundException - if no device data found for one componant device.

DeviceArray

public DeviceArray(java.lang.String name,
                   java.lang.String[] names)
            throws DataNotFoundException,
                   java.io.IOException
Constructs a device array from a dynamic list. Use the default control system. Doc to be completed.
See Also:
DeviceArray(String,String[],ControlSystem)
Method Detail

getDeviceClass

public DeviceClass getDeviceClass()
                           throws DataNotFoundException
Returns the reference to the device class this device belongs to. A unique common device class must be found among the components.
Overrides:
getDeviceClass in class Device
Throws:
DataNotFoundException - if no device class found or if more than one.

needCycleType

public boolean needCycleType()
                      throws DataNotFoundException
Returns true if the I/O may require a cycle type. Returns true if any of the component devices need a cycle type, false otherwise.
Overrides:
needCycleType in class Device
Tags copied from class: Device
Throws:
DataNotFoundException - if no directory service or no device data

size

public final int size()
Returns the number of components in this device array.

getDeviceDatas

public DeviceData[] getDeviceDatas()
                            throws DataNotFoundException
Returns the array of DeviceData

getNames

public java.lang.String[] getNames()
                            throws DataNotFoundException
Returns the names of the components in this device array.

getDevices

public final Device[] getDevices()
                          throws DataNotFoundException,
                                 java.io.IOException
Returns component as independant devices. Returns an array of devices sharing the same context and the same control system as this device.