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
|
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 | } |
---|
[1588] | 30 | //return new SmithWaterman(input1,input2,submat,threshold); |
---|
[1589] | 31 | //return new NeedlemanWunsch(input1,input2,submat,threshold); |
---|
[1612] | 32 | //return new SmithWatermanRepeated(input1,input2,submat,threshold); |
---|
| 33 | return (AlignmentAlgorithm) object; |
---|
[1586] | 34 | } |
---|
| 35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.