Class CategoryManager


  • public class CategoryManager
    extends java.lang.Object
    A singleton to manage Categories of Torrents (DownloadManagers).
    • Constructor Detail

      • CategoryManager

        public CategoryManager()
    • Method Detail

      • addCategoryManagerListener

        public static void addCategoryManagerListener​(CategoryManagerListener l)
        Add a CategoryManager Listener
        Parameters:
        l - Listener to Add
      • createCategory

        public static Category createCategory​(java.lang.String name)
        Creates a new Category object and adds it to the list
        Parameters:
        name - Name of Category to add
        Returns:
        If successful, returns the newly created Category. Otherwise, returns null.
      • removeCategory

        public static void removeCategory​(Category category)
        Removes a Category from the list
        Parameters:
        category - Category to remove
      • getCategories

        public static Category[] getCategories()
        Retrieves the list of Categories To sort the categories by name (TYPE_USER last): Arrays.sort(categories);
        Returns:
        List of Categories
      • getCategory

        public static Category getCategory​(java.lang.String name)
        Retrieve a Category
        Parameters:
        name - Name of Category
        Returns:
        Category you asked for
      • getCategory

        public static Category getCategory​(int type)
        Retrieve a non-user Category
        Parameters:
        type - any type except TYPE_USER
        Returns:
        The Category, or null if not found.
        See Also:
        USER_ constants
      • getCategorisedDownloadCount

        public static int getCategorisedDownloadCount()