Rev | Line | |
---|
[1586] | 1 | package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms; |
---|
| 2 | |
---|
[1612] | 3 | import java.lang.reflect.Constructor; |
---|
| 4 | import java.lang.reflect.InvocationTargetException; |
---|
| 5 | |
---|
[1586] | 6 | import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix; |
---|
| 7 | |
---|
| 8 | public class AlignmentAlgorithmFactory { |
---|
| 9 | |
---|
[1612] | 10 | public static void setDefaultAlgorithm(String algorithmname) { |
---|
| 11 | //TODO: check for valid algorihm class names here |
---|
| 12 | algorithmclass = algorithmname; |
---|
| 13 | } |
---|
[1586] | 14 | |
---|
[1612] | 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; |
---|
[1586] | 31 | } |
---|
| 32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.