Changeset 1612 for branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithmFactory.java
- Timestamp:
- 07/14/14 23:27:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ralph/src/main/java/de/ugoe/cs/autoquest/tasktrees/alignment/algorithms/AlignmentAlgorithmFactory.java
r1589 r1612 1 1 package de.ugoe.cs.autoquest.tasktrees.alignment.algorithms; 2 3 import java.lang.reflect.Constructor; 4 import java.lang.reflect.InvocationTargetException; 2 5 3 6 import de.ugoe.cs.autoquest.tasktrees.alignment.matrix.SubstitutionMatrix; … … 5 8 public class AlignmentAlgorithmFactory { 6 9 10 public static void setDefaultAlgorithm(String algorithmname) { 11 //TODO: check for valid algorihm class names here 12 algorithmclass = algorithmname; 13 } 7 14 8 public static AlignmentAlgorithm create(int[] input1, int[] input2, SubstitutionMatrix submat,float threshold) { 9 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 } 10 30 //return new SmithWaterman(input1,input2,submat,threshold); 11 31 //return new NeedlemanWunsch(input1,input2,submat,threshold); 12 return new SmithWatermanRepeated(input1,input2,submat,threshold); 32 //return new SmithWatermanRepeated(input1,input2,submat,threshold); 33 return (AlignmentAlgorithm) object; 13 34 } 14 35 }
Note: See TracChangeset
for help on using the changeset viewer.