File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ local.properties
2525
2626# Locally stored "Eclipse launch configurations"
2727* .launch
28+ /bin
Original file line number Diff line number Diff line change 11package de .littlerolf .sav ;
22
3+ import de .littlerolf .sav .loader .*;
4+
35public class SortAlgorithmVisualizer {
46 public static void main (String [] args ) {
57
Original file line number Diff line number Diff line change 1+ package de .littlerolf .sav .loader ;
2+
3+ public interface Sortable {
4+
5+ public int [] sort (int [] numbers );
6+ public String getName ();
7+ }
Original file line number Diff line number Diff line change @@ -20,10 +20,18 @@ public class SorterLoader {
2020
2121 private List <Class > classes = new ArrayList <Class >();
2222
23+ /**
24+ * Creates a new SorterLoader looking for classes in the given path
25+ * @param path The path to look for classes
26+ */
2327 public SorterLoader (String path ) {
2428 classpath = path ;
2529
2630 }
31+
32+ /**
33+ * Loads all classes named 'Sorter' from the set folder from all the subdirectories
34+ */
2735 public void loadAllClasses () {
2836 // Create a File object on the root of the directory containing the class file
2937 File file = new File (classpath );
@@ -38,6 +46,7 @@ public void loadAllClasses() {
3846
3947 String [] directories = getSubdirectories ();
4048
49+
4150 for (String folder : directories ) {
4251 classes .add (cl .loadClass (folder + ".Sorter" ));
4352 }
You can’t perform that action at this time.
0 commit comments