Commit bb0aa342 authored by edmundszagars's avatar edmundszagars
Browse files

removeIf() methods for CheckBox'es no longer uses constant String values for...

removeIf() methods for CheckBox'es no longer uses constant String values for TypeName to remove items
parent 8f458606
......@@ -57,7 +57,7 @@ public class MainWindow extends Application {
sortables.add(new BubbleSort());
System.out.println("Sortable size now: " + sortables.size());
} else if (!bubbleSortCheckBox.isSelected()) {
sortables.removeIf(p -> p.getSortTypeName().equals("Bubble sort"));
sortables.removeIf(p -> p.getSortTypeName().equals(p.getSortTypeName()));
System.out.println("Sortable size now: " + sortables.size());
}
});
......@@ -71,7 +71,7 @@ public class MainWindow extends Application {
sortables.add(new SelectionSort());
System.out.println("Sortable size now: " + sortables.size());
} else if (!selectionSortCheckBox.isSelected()) {
sortables.removeIf(p -> p.getSortTypeName().equals("Selection sort"));
sortables.removeIf(p -> p.getSortTypeName().equals(p.getSortTypeName()));
System.out.println("Sortable size now: " + sortables.size());
}
});
......@@ -86,7 +86,7 @@ public class MainWindow extends Application {
System.out.println("Sortable size now: " + sortables.size());
} else if (!insertionSortCheckBox.isSelected()) {
sortables.removeIf(p -> p.getSortTypeName().equals("Insertion sort"));
sortables.removeIf(p -> p.getSortTypeName().equals(p.getSortTypeName()));
System.out.println("Sortable size now: " + sortables.size());
}
});
......@@ -101,7 +101,7 @@ public class MainWindow extends Application {
System.out.println("Sortable size now: " + sortables.size());
} else if (!quickSortCheckBox.isSelected()) {
sortables.removeIf(p -> p.getSortTypeName().equals("Quick sort"));
sortables.removeIf(p -> p.getSortTypeName().equals(p.getSortTypeName()));
System.out.println("Sortable size now: " + sortables.size());
}
});
......@@ -116,7 +116,7 @@ public class MainWindow extends Application {
System.out.println("Sortable size now: " + sortables.size());
} else if (!mergeSortCheckBox.isSelected()) {
sortables.removeIf(p -> p.getSortTypeName().equals("Merge sort"));
sortables.removeIf(p -> p.getSortTypeName().equals(p.getSortTypeName()));
System.out.println("Sortable size now: " + sortables.size());
}
});
......@@ -172,7 +172,6 @@ public class MainWindow extends Application {
result.setSortTypeName(sortable.getSortTypeName());
result.setArraySize(ar);
table.getItems().add(result);
//System.out.println(sortable.getClass() + "\n" + Arrays.toString(ar));
}
}
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment