fr.emn.reactiveinput
Class EmptyFolder

java.lang.Object
  extended byfr.emn.reactiveinput.AbstractFolder
      extended byfr.emn.reactiveinput.EmptyFolder
All Implemented Interfaces:
DeviceFolder, DeviceFolderContainer

public class EmptyFolder
extends AbstractFolder

This is an empty folder which contains no device, only subfolders.


Field Summary
 
Fields inherited from class fr.emn.reactiveinput.AbstractFolder
children, devices, name, parent
 
Constructor Summary
EmptyFolder(java.lang.String name)
           
 
Method Summary
 DeviceDescriptor getDefaultDescriptor()
          Returns a "no-device" descriptor
 DeviceDescriptor getDefaultDescriptor(Device device)
          Returns the descriptor that will be used to build device's default signature.
 
Methods inherited from class fr.emn.reactiveinput.AbstractFolder
add, add, add, canAdd, findFolder, getName, getParent, getPrototypes, getSubfolders, remove, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmptyFolder

public EmptyFolder(java.lang.String name)
Parameters:
name -
Method Detail

getDefaultDescriptor

public DeviceDescriptor getDefaultDescriptor()
Returns a "no-device" descriptor


getDefaultDescriptor

public DeviceDescriptor getDefaultDescriptor(Device device)
Description copied from interface: DeviceFolder
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).