An algorithm is initialised with an instance of the Configuration class. This object contains gesture sets, an event manager and algorithm-specific parameters which are managed in a name/value collection. The init method throws an exception if the initialisation process fails. This exception can have different types informing about the specific error that happened.
The configuration object can be managed using the Java API or by importing the data from an XML document with the structure described in Appendix. The storage in an external XML file has the advantage that parameters and the gesture sets can be adjusted whiteout recompiling the application source code. However, the full power of the configuration object can only be accessed based on the Java API. It is for not possible to set an event manager within the XML file. However, event managers can be added based on the Java API after loading the XML file.
The implementation of an algorithm is responsible for the validation of the configuration object. This means that algorithms have to check if all the necessary parameters have been set and if all required descriptors are available. If the initialisation process does not throw an exception, the user can assume that the algorithm is ready to recognise gestures. Furthermore, the implementation is obligated to observe the minimal accuracy and the maximal result set size stored in the configuration object and notifies the event manager about recognised gestures.
The AlgorithmFactory class provides static methods to create algorithms with a configuration instance and uses dynamic class loading to instantiate the algorithms.