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