fr.emn.reactiveinput
Class AbstractFolder

java.lang.Object
  extended byfr.emn.reactiveinput.AbstractFolder
All Implemented Interfaces:
DeviceFolder, DeviceFolderContainer
Direct Known Subclasses:
ClassFolder, EmptyFolder, SystemFolder

public abstract class AbstractFolder
extends java.lang.Object
implements DeviceFolderContainer

This is an abstract folder in which you can add devices and subfolders.


Field Summary
protected  java.util.Vector children
           
protected  java.util.Vector devices
           
protected  java.lang.String name
           
protected  DeviceFolderContainer parent
           
 
Constructor Summary
AbstractFolder(java.lang.String name)
           
 
Method Summary
 void add(Device d)
          Adds a device to the folder.
 void add(DeviceFolder folder)
          Adds a folder.
 void add(int index, DeviceFolder folder)
           
 boolean canAdd(Device d)
          Returns whether the device d matches the default folder descriptor.
 AbstractFolder findFolder(java.lang.String name)
          Find a DeviceFolder from its name.
 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.
 DeviceFolder[] getSubfolders()
           
 void remove(DeviceFolder folder)
           
 void setParent(DeviceFolderContainer parent)
          Allows this folder to be added to a parent folder (don't call this method, instead use parent's "add" method).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.emn.reactiveinput.DeviceFolder
getDefaultDescriptor, getDefaultDescriptor
 

Field Detail

name

protected java.lang.String name

devices

protected java.util.Vector devices

children

protected java.util.Vector children

parent

protected DeviceFolderContainer parent
Constructor Detail

AbstractFolder

public AbstractFolder(java.lang.String name)
Method Detail

add

public void add(Device d)
Adds a device to the folder. The device is not added if it does not match the default folder descriptor.


add

public void add(DeviceFolder folder)
Adds a folder.

Specified by:
add in interface DeviceFolderContainer

add

public void add(int index,
                DeviceFolder folder)

canAdd

public boolean canAdd(Device d)
Returns whether the device d matches the default folder descriptor.


getName

public java.lang.String getName()
Specified by:
getName in interface DeviceFolder

getParent

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

Specified by:
getParent in interface DeviceFolder

getPrototypes

public Device[] getPrototypes()
Description copied from interface: DeviceFolder
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.

Specified by:
getPrototypes in interface DeviceFolder

getSubfolders

public DeviceFolder[] getSubfolders()
Specified by:
getSubfolders in interface DeviceFolderContainer

remove

public void remove(DeviceFolder folder)
Specified by:
remove in interface DeviceFolderContainer

findFolder

public AbstractFolder findFolder(java.lang.String name)
Find a DeviceFolder from its name.

Parameters:
name - the DeviceFolder name
Returns:
the DeviceFolder or null.

setParent

public void setParent(DeviceFolderContainer parent)
Allows this folder to be added to a parent folder (don't call this method, instead use parent's "add" method).

Specified by:
setParent in interface DeviceFolder