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

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

Removed parameters from alignmentalgorihm factory constructor and changed interface by adding a new align() method, which now gets all the data via parameter

File size: 1.1 KB
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 new SmithWaterman(input1,input2,submat,threshold);
31                //return new NeedlemanWunsch(input1,input2,submat,threshold);
32                //return new SmithWatermanRepeated(input1,input2,submat,threshold);
33                return (AlignmentAlgorithm) object;
34        }
35}
Note: See TracBrowser for help on using the repository browser.