1 /*
2 * @(#)$Id: Algorithm.java 824 2010-05-26 22:38:01Z bpuype $
3 *
4 * Author : Ueli Kurmann, igesture@uelikurmann.ch
5 *
6 * Purpose : Interface to be implemented by any gesture recognition
7 * algorithm.
8 *
9 * -----------------------------------------------------------------------
10 *
11 * Revision Information:
12 *
13 * Date Who Reason
14 *
15 * Dec 26, 2006 ukurmann Initial Release
16 * Feb 27, 2007 bsigner Cleanup
17 *
18 * -----------------------------------------------------------------------
19 *
20 * Copyright 1999-2009 ETH Zurich. All Rights Reserved.
21 *
22 * This software is the proprietary information of ETH Zurich.
23 * Use is subject to license terms.
24 *
25 */
26
27
28 package org.ximtec.igesture.algorithm;
29
30 import org.ximtec.igesture.configuration.Configuration;
31 import org.ximtec.igesture.core.Gesture;
32 import org.ximtec.igesture.core.ResultSet;
33
34
35 /**
36 * Interface to be implemented by any gesture recognition algorithm.
37 *
38 * @version 1.0, Dec 2006
39 * @author Ueli Kurmann, igesture@uelikurmann.ch
40 * @author Beat Signer, signer@inf.ethz.ch
41 */
42 public interface Algorithm {
43
44 /**
45 * Initialises the algorithm.
46 *
47 * @param configuration the configuration to be used for the initialisation of
48 * the algorithm.
49 * @throws AlgorithmException if there is a problem in the algorithm's
50 * initialisation phase.
51 */
52 public void init(Configuration configuration) throws AlgorithmException;
53
54
55 /**
56 * Runs the recogniser on a given set of strokes represented by a gesture.
57 *
58 * @param gesture the gesture to be recognised.
59 * @return the result set containing the recognised gesture classes.
60 * @throws AlgorithmException if there was an exception while recognising the
61 * note.
62 */
63 public ResultSet recognise(Gesture< ? > gesture) throws AlgorithmException;
64
65
66 /**
67 * Returns an array of containing the configuration parameters.
68 *
69 * @return the configuration parameters.
70 */
71 public Enum< ? >[] getConfigParameters();
72
73
74 /**
75 * Returns the default value for a given parameter.
76 *
77 * @param parameterName the name of the parameter whose default value has to
78 * be returned.
79 * @return the default value for the specified parameter.
80 */
81 public String getDefaultParameterValue(String parameterName);
82
83 /**
84 * Get the type of algorithm
85 * @see org.ximtec.igesture.util.Constant
86 */
87 public int getType();
88 }