fr.emn.reactiveinput
Interface DeviceFolder

All Known Subinterfaces:
DeviceFolderContainer
All Known Implementing Classes:
AbstractFolder, FStdCompound, FStdInput

public interface DeviceFolder

Contains a set of available devices.


Method Summary
 DeviceDescriptor getDefaultDescriptor()
          Returns a descriptor telling all possible devices this folder can contain in all possible environments (DDFolder not included).
 DeviceDescriptor getDefaultDescriptor(Device device)
          Returns the descriptor that will be used to build device's default signature.
 java.lang.String getName()
           
 DeviceFolderContainer getParent()
          Allows this folder to be added to a parent folder.
 Device[] getPrototypes()
          Returns all available prototypes from this folder for the current environment.
 void setParent(DeviceFolderContainer parent)
          Allows this folder to be added to a parent folder.
 

Method Detail

getDefaultDescriptor

public DeviceDescriptor getDefaultDescriptor()
Returns a descriptor telling all possible devices this folder can contain in all possible environments (DDFolder not included).

Returns DDAny if this descriptor can contain every kind of device, or returns a more restrictive DeviceDescriptor defining the particular kind of devices associated with this folder.


getDefaultDescriptor

public DeviceDescriptor getDefaultDescriptor(Device device)
Returns the descriptor that will be used to build device's default signature.

The device signature is used to serialize the device, i.e. retreive it in further executions of the virtual machine. The default signature of the device D from folder F is given by the combination (DDAnd) of three descriptors (See getDefaultSignature() method in DescriptorManager class):

1) new DDFolder(F)

2) F.getDefaultDescriptor()

3) F.getDefaultDescriptor(D)

Two devices with the same signature are equivalent in functionnality. Device equivalence must be defined as restrictive as possible. However, this method must only return information that is useful to identify the device inside the folder.

For example, if all devices of the same class are equivalent for a given folder (as in standard.processors folder), you can return a class descriptor (DDClass). However, in folders that provide devices of the same class with different functionnalities, you must use an alternate method for identifying them (such as their name, or other properties).

Note1: When possible, move factorizable descriptors in getDefaultDescriptor(void) method.

Note2: Do not include descriptors that are already defined in getDefaultDescriptor(void).


getName

public java.lang.String getName()

getParent

public DeviceFolderContainer getParent()
Allows this folder to be added to a parent folder.


getPrototypes

public Device[] getPrototypes()
Returns all available prototypes from this folder for the current environment.

Prototype devices include copiable devices and static devices. Copiable devices must be copied before using them.

Note: This method must not return devices that do not match the getDefaultDescriptor(void) method.


setParent

public void setParent(DeviceFolderContainer parent)
Allows this folder to be added to a parent folder.