fr.emn.reactiveinput
Class Finder

java.lang.Object
  extended byfr.emn.reactiveinput.Finder

public class Finder
extends java.lang.Object

Device finding methods always try to return copies of folder prototypes.


Constructor Summary
Finder()
           
 
Method Summary
static void deviceProperties(Device d, java.lang.String[] properties, java.lang.String[] values)
          Internal use.
static Device findDevice(DeviceFolder folder, DeviceDescriptor descriptor)
          Returns the first device matching the given descriptor in the given folder, including all its subfolders.
static Device[] findDeviceMatch(DeviceFolder f, DeviceDescriptor[] desc)
          Find an array of devices matching the given array of descriptors, with distinct declared slots.
static Device[] findDevices(DeviceFolder folder, DeviceDescriptor descriptor)
          Returns all available devices matching the given descriptor in the given folder, including all its subfolders.
static In findIn(Device d, InDescriptor desc)
          Find in the given device an input slot matching the given descriptor.
static In[] findInMatch(Device d, InDescriptor[] desc)
          Find in the given device an array of distinct input slots matching the given array of descriptors.
static In[] findIns(Device d, InDescriptor desc)
          Find in the given device all input slots matching the given descriptor.
static Out findOut(Device d, OutDescriptor desc)
          Find in the given device an output slot matching the given descriptor.
static Out[] findOutMatch(Device d, OutDescriptor[] desc)
          Find in the given device an array of distinct output slots matching the given array of descriptors.
static Out[] findOuts(Device d, OutDescriptor desc)
          Find in the given device all output slots matching the given descriptor.
static boolean isComplete(java.lang.Object[] match)
          Returned true if a match is complete (i.e. contains no null).
static java.lang.String retreiveAlias(Device device)
           
static java.lang.String retreiveAlias(Slot slot)
           
static Device retreiveDevice(java.lang.String alias)
          Retrieves the device that has been assigned the given alias since the last call to findMatch(DeviceFolder, DeviceDescriptor[]).
static java.lang.String retreiveFullAlias(Slot slot)
           
static Slot retreiveSlot(Device d, java.lang.String alias)
          Retrieves the device slot that has been assigned the given alias since the last call to find(DeviceFolder, DeviceDescriptor), findAll(DeviceFolder, DeviceDescriptor), or findMatch(DeviceFolder, DeviceDescriptor[]).
static Slot retreiveSlot(java.lang.String fullAlias)
          Retrieves the slot that has been assigned the given alias since the last call to findMatch(DeviceFolder, DeviceDescriptor[]).
static java.util.HashMap retreiveSlotAliases(Device d)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Finder

public Finder()
Method Detail

deviceProperties

public static void deviceProperties(Device d,
                                    java.lang.String[] properties,
                                    java.lang.String[] values)
Internal use.

This method should not be public. Calling it directly will have no effect.


findDevice

public static Device findDevice(DeviceFolder folder,
                                DeviceDescriptor descriptor)
Returns the first device matching the given descriptor in the given folder, including all its subfolders.

If the descriptor contains slot declarations, use retreiveSlot(Device d, String alias) to retreive matching slots by alias.


findDeviceMatch

public static Device[] findDeviceMatch(DeviceFolder f,
                                       DeviceDescriptor[] desc)
Find an array of devices matching the given array of descriptors, with distinct declared slots.

If the descriptor array contains device declarations, use retreiveDevice(String alias) to retreive matching devices by alias.

If slot declarations were provided, use retreiveSlot(Device d, String alias) or getDeclaredSlot(String fullAlias) to retreive matching slots by alias.

Use isComplete(solution) to test the completeness of the result. PENDING: Use a multiple pass algorithm.


findDevices

public static Device[] findDevices(DeviceFolder folder,
                                   DeviceDescriptor descriptor)
Returns all available devices matching the given descriptor in the given folder, including all its subfolders.

Returns null if none.

If the descriptor contains slot declarations, use retreiveSlot(Device d, String alias) to retreive matching slots by alias.


findIn

public static In findIn(Device d,
                        InDescriptor desc)
Find in the given device an input slot matching the given descriptor.

Returns null if not found.


findInMatch

public static In[] findInMatch(Device d,
                               InDescriptor[] desc)
Find in the given device an array of distinct input slots matching the given array of descriptors.

If an array of n InDescriptors is provided, returns an array of n Ins with the same order. This array may contain nulls if match is incomplete (it means that no better result exists). Use isComplete() method to test the completeness of returned match.


findIns

public static In[] findIns(Device d,
                           InDescriptor desc)
Find in the given device all input slots matching the given descriptor.

Returns null if none.


findOut

public static Out findOut(Device d,
                          OutDescriptor desc)
Find in the given device an output slot matching the given descriptor.

Returns null if not found.


findOutMatch

public static Out[] findOutMatch(Device d,
                                 OutDescriptor[] desc)
Find in the given device an array of distinct output slots matching the given array of descriptors.

If an array of n OutDescriptors is provided, returns an array of n Outs with the same order. This array may contain nulls if match is incomplete (it means that no better result exists). Use isComplete() method to test the completeness of returned match.


findOuts

public static Out[] findOuts(Device d,
                             OutDescriptor desc)
Find in the given device all output slots matching the given descriptor.

Returns null if none.


isComplete

public static boolean isComplete(java.lang.Object[] match)
Returned true if a match is complete (i.e. contains no null).

Use with findMatch() methods.


retreiveAlias

public static java.lang.String retreiveAlias(Device device)

retreiveAlias

public static java.lang.String retreiveAlias(Slot slot)

retreiveDevice

public static Device retreiveDevice(java.lang.String alias)
Retrieves the device that has been assigned the given alias since the last call to findMatch(DeviceFolder, DeviceDescriptor[]).


retreiveFullAlias

public static java.lang.String retreiveFullAlias(Slot slot)

retreiveSlot

public static Slot retreiveSlot(Device d,
                                java.lang.String alias)
Retrieves the device slot that has been assigned the given alias since the last call to find(DeviceFolder, DeviceDescriptor), findAll(DeviceFolder, DeviceDescriptor), or findMatch(DeviceFolder, DeviceDescriptor[]).


retreiveSlot

public static Slot retreiveSlot(java.lang.String fullAlias)
Retrieves the slot that has been assigned the given alias since the last call to findMatch(DeviceFolder, DeviceDescriptor[]).

The slot alias is given in its full form 'devAlias.slotAlias'.


retreiveSlotAliases

public static java.util.HashMap retreiveSlotAliases(Device d)