© 2006-2007 ETH Zurich

org.ximtec.igesture.algorithm
Class AlgorithmTool

java.lang.Object
  extended by org.ximtec.igesture.algorithm.AlgorithmTool

public class AlgorithmTool
extends Object

Static helper methods used by different algorithms.

Version:
1.0 Dec 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Constructor Summary
AlgorithmTool()
           
 
Method Summary
static double getDoubleParameterValue(String parameter, Map<String,String> parameters, Map<String,String> defaultParameters)
          Returns a double parameter.
static int getIntParameterValue(String parameter, Map<String,String> parameters, Map<String,String> defaultParameters)
          Returns an int parameter.
static String getParameterValue(String parameter, Map<String,String> parameters, Map<String,String> defaultParameters)
          Returns a string parameter value. given is a parameter name and two maps with name/value parameters.
static boolean verifyDescriptor(GestureSet set, Class<? extends Descriptor> descriptorType)
          Returns true if all Gesture Classes of the Gesture Set have the required descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmTool

public AlgorithmTool()
Method Detail

getParameterValue

public static String getParameterValue(String parameter,
                                       Map<String,String> parameters,
                                       Map<String,String> defaultParameters)
Returns a string parameter value. given is a parameter name and two maps with name/value parameters. If the parameter is not available in the first set, the default value is returned.

Parameters:
parameter - the parameter name.
parameters - the map with parameter name/value pairs.
defaultParameters - the map with default parameter name/value pairs.
Returns:
the parameter value.

getDoubleParameterValue

public static double getDoubleParameterValue(String parameter,
                                             Map<String,String> parameters,
                                             Map<String,String> defaultParameters)
Returns a double parameter.

Parameters:
parameter - the parameter name.
parameters - the map with parameter name/value pairs.
defaultParameters - the map with default parameter name/value pairs.
Returns:
the parameter value.
See Also:
getParameterValue(java.lang.String, java.util.Map, java.util.Map)

getIntParameterValue

public static int getIntParameterValue(String parameter,
                                       Map<String,String> parameters,
                                       Map<String,String> defaultParameters)
Returns an int parameter.

Parameters:
parameter - the parameter name.
parameters - the map with parameter name/value pairs.
defaultParameters - the map with default parameter name/value pairs.
Returns:
the parameter value.
See Also:
getParameterValue(java.lang.String, java.util.Map, java.util.Map)

verifyDescriptor

public static boolean verifyDescriptor(GestureSet set,
                                       Class<? extends Descriptor> descriptorType)
Returns true if all Gesture Classes of the Gesture Set have the required descriptor. As soon that one Class does not fulfill the requirements the result is false.

Parameters:
set - the gesture set to test.
descriptorType - the descriptor type.
Returns:
true if all gesture classes of the gesture set have the specified descriptor.

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.