Written by Jonas Altrock (ew20b126@technikum-wien.at).
The fifth exercise is about generic classes and the java collection framework.
A generic class (or interface) has a type parameter <T>, which is
passed in when the class is used. The parameter can be everywhere
in the definition of the class where a concrete type would be used.
So as the type for properties, for constructor or method arguments, as the
return type for methods, and as a type for variables declared in the class
scope or any method body.
The java collection framework contains interfaces and classes pertaining to an abstract treatment of "multiple things" as a collection, i.e. arrays, lists, trees, sets, and more. The aim is to be able to treat many data structures in the same way, making it possible to switch out one implementation for a different one that might be faster in some circumstances, without having to change the code that does the things with the data contained within a collection.
The official java documentation has more information about the Java collections framework.
This assignment was a lot of work:
Comparator<Track>:
MyMatcher<T>:
MyFormatter<T> interface:
MyTrackContainer, which contains a set of tracks and allows selecting, filtering and sorting them,
using the matchers and comparators.
The entity classes remain the same as in ES04, as does the ConsoleScanable interface and implementation.