© 2006-2007 ETH Zurich

org.ximtec.igesture.algorithm
Class AlgorithmFactory

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

public class AlgorithmFactory
extends Object

The factory used to create algorithms.

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

Constructor Summary
AlgorithmFactory()
           
 
Method Summary
static Algorithm createAlgorithm(Configuration config)
          Instantiates an algorithm with a given configuration object.
static Algorithm createAlgorithm(InputStream configuration)
          Instantiates an algorithm with a specific configuration object.
static Algorithm createAlgorithm(InputStream config, InputStream set)
          Creates a new algorithm instance.
static Algorithm createAlgorithmInstance(String className)
          Creates an algorithm instance.
static List<Algorithm> createAlgorithms(Configuration config)
          Creates a list of algorithms and initialises them with the parameters provided in the configuration object.
static List<Algorithm> createAlgorithms(InputStream configuration)
          Creates a list of algorithms and initialises them with the parameters provided in the configuration object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlgorithmFactory

public AlgorithmFactory()
Method Detail

createAlgorithms

public static List<Algorithm> createAlgorithms(InputStream configuration)
                                        throws AlgorithmException
Creates a list of algorithms and initialises them with the parameters provided in the configuration object.

Parameters:
configuration - the input stream from where the XML configuration can be read from.
Returns:
the list of algorithms.
Throws:
AlgorithmException - if the algorithms could not be created.

createAlgorithms

public static List<Algorithm> createAlgorithms(Configuration config)
                                        throws AlgorithmException
Creates a list of algorithms and initialises them with the parameters provided in the configuration object.

Parameters:
config - the configuration object.
Returns:
the list of algorithms.
Throws:
AlgorithmException - if the algorithms could not be created.

createAlgorithm

public static Algorithm createAlgorithm(InputStream configuration)
                                 throws AlgorithmException
Instantiates an algorithm with a specific configuration object.

Parameters:
configuration - the input stream from which the XML configuration can be read from.
Returns:
the initialised algorithm.
Throws:
AlgorithmException - if the algorithm could not be created.

createAlgorithm

public static Algorithm createAlgorithm(InputStream config,
                                        InputStream set)
                                 throws AlgorithmException
Creates a new algorithm instance.

Parameters:
config - the input stream from which the XML configuration can be read from.
set - the input stream from which the XML gesture set can be read from.
Returns:
the initialised algorithm.
Throws:
AlgorithmException - if the algorithm could not be created.

createAlgorithm

public static Algorithm createAlgorithm(Configuration config)
                                 throws AlgorithmException
Instantiates an algorithm with a given configuration object.

Parameters:
config - the configuration of the algorithm.
Returns:
the initialised algorithm.
Throws:
AlgorithmException - if the algorithm could not be created.

createAlgorithmInstance

public static Algorithm createAlgorithmInstance(String className)
Creates an algorithm instance.

Parameters:
className - the full qualified name of the algorithm.
Returns:
the instance of the algorithm.

© 2006-2007 ETH Zurich

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