cdev.dir
Interface DeviceProperty


public interface DeviceProperty
extends DirectoryItem

DeviceProperty accesses data associated with a property. A property corresponds to a device value we can always read and often also write.

Get a DeviceProperty object for an instance of DeviceClass with DeviceClass#getProperty(propertyName).

Get a list of attributes with getCharacteristicNames() and a corresponding value with getCharacteristicValue(characteristicName).

You can also obtain a DeviceProperty object with DirectoryService#getDeviceProperty(propertyName,className).
You can obtain a DeviceProperty object common to several classes with DirectoryService#getCommonProperty(propertyName,classNames).

This description should be completed with a set of conventions for standard characteristics and their value domain.

General documentation in DirectoryService .

See Also:
DeviceClass, BitPatternDefinition, DeviceList

Method Summary
 java.lang.String[] getCharacteristicNames()
          Return array of names of characteristics for the property.
 java.lang.Object getCharacteristicValue(java.lang.String characteristicName)
          Gets the value of the characteristic.
 java.lang.String getClassName()
          Gets the name of the device class to which the property belongs.
 int getDim()
          Gets the number of dimensions.
 int[] getDimensions()
          Gets the array of dimensions.
 int getEnumeratedType()
          Gets the enumerated data type of the property (returns an int).
 boolean isConstant()
          Return true if property value can be considered constant and needs to be fetched only once (min, max, ...).
 boolean isDefined(java.lang.String characteristic)
          Return true if the characteristic is defined for the property.
 boolean isDiscrete()
          Returns true if this is a discrete property.
 boolean isWritable()
          Return true if property can write values.
 boolean needCycleType()
          Return true if property value depends on cycle type.
 
Methods inherited from interface cdev.dir.DirectoryItem
getDescription, getInfo, getInfoLines, getInfoWidth, getName, getServiceName, toString
 

Method Detail

getCharacteristicNames

public java.lang.String[] getCharacteristicNames()
                                          throws NoSuchDataException,
                                                 BadConnectionException
Return array of names of characteristics for the property.
Returns:
array of names of characteristics
Throws:
NoSuchDataException - -
BadConnectionException - -

getCharacteristicValue

public java.lang.Object getCharacteristicValue(java.lang.String characteristicName)
                                        throws NoSuchDataException,
                                               BadConnectionException,
                                               BadQueryException
Gets the value of the characteristic. This is either a DataEntry object or else a DeviceProperty object when the value must be obtained with a property. The key for the DataEntry object is set to 0.
Parameters:
characteristicName - the name of the characteristic
Returns:
characteristic value as DataEntry or DeviceProperty object.
Throws:
NoSuchDataException - -
BadConnectionException - -
BadQueryException - -

getClassName

public java.lang.String getClassName()
Gets the name of the device class to which the property belongs.
Returns:
the name of the device class

getDim

public int getDim()
Gets the number of dimensions.
Returns:
number of dimensions (0 if scalar)

getDimensions

public int[] getDimensions()
Gets the array of dimensions.
Returns:
array of dimensions

getEnumeratedType

public int getEnumeratedType()
Gets the enumerated data type of the property (returns an int).
Returns:
data type (enumeration)

isConstant

public boolean isConstant()
Return true if property value can be considered constant and needs to be fetched only once (min, max, ...).
Returns:
true if property refers to a constant value

isDefined

public boolean isDefined(java.lang.String characteristic)
Return true if the characteristic is defined for the property.
Parameters:
characteristic - the name of the characteristic
Returns:
true if the characteristic is defined for the property

isDiscrete

public boolean isDiscrete()
Returns true if this is a discrete property. For discrete properties you can get further information with getDiscretePattern.
Returns:
true if this is a discrete property

isWritable

public boolean isWritable()
Return true if property can write values.
Returns:
true if property can write values

needCycleType

public boolean needCycleType()
Return true if property value depends on cycle type.
Returns:
true if property value depends on cycle type