CatalogItem Class

CatalogItem is a generic class that will take a type parameter S which will be bounded by the Comparable interface. S represents the type of a CatalogItem's contained object and must extend the Media interface that we have created. CatalogItem must also implement the Comparable interface itself so that we may sort CatalogItems.

Hence, the CatalogItem class would be declared as follows :

  public class CatalogItem<S extends Media> implements Comparable<CatalogItem<S>>
  {
	//your code
  }