Line | |
---|
1 | package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms; |
---|
2 | |
---|
3 | |
---|
4 | public 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.