source: branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithmFactory.java @ 1613

Last change on this file since 1613 was 1613, checked in by rkrimmel, 10 years ago

Removing some unused code

File size: 980 bytes
Line 
1package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms;
2
3import java.lang.reflect.Constructor;
4import java.lang.reflect.InvocationTargetException;
5
6import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix;
7
8public class AlignmentAlgorithmFactory {
9       
10        public static void setDefaultAlgorithm(String algorithmname) {
11                //TODO: check for valid algorihm class names here
12                algorithmclass = algorithmname;
13        }
14       
15        private static String algorithmclass = "de.ugoe.cs.autoquest.tasktrees.alignment.algorithms.SmithWatermanRepeated";
16       
17       
18       
19        public static AlignmentAlgorithm create() {
20                Class<?> newclass;
21                Object object = null;
22                try {
23                         newclass = Class.forName(algorithmclass);
24                         object = newclass.newInstance();
25                       
26                } catch (ClassNotFoundException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException e) {
27                        // TODO Auto-generated catch block
28                        e.printStackTrace();
29                }
30                return (AlignmentAlgorithm) object;
31        }
32}
Note: See TracBrowser for help on using the repository browser.