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

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

Small fixes

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