Class CategorySet

    • Constructor Detail

      • CategorySet

        public CategorySet()
        Constructs an empty cateogries container. It is dedicated to the persistence engine.
    • Method Detail

      • add

        public void add​(String categoryId)
        Adds a category to a PlannableOnCalendar. The category is specified by its unique identifier (its title for example). If the category is already added, then nothing is done.
        Parameters:
        categoryId - the identifier of the category to add.
      • addAll

        public void addAll​(List<String> categoryIds)
        Adds several categories to a PlannableOnCalendar. The categories are specified by their unique identifier (their title for example). If some of the categories to add are already present, then they are not added.
        Parameters:
        categoryIds - the identifiers of the categories to add.
      • addAll

        public void addAll​(String... categoryIds)
        Adds one or several categories to a PlannableOnCalendar. The categories are specified by their unique identifier (their title for example). If some of the categories to add are already present, then they are not added.
        Parameters:
        categoryIds - the identifiers of the categories to add.
      • remove

        public void remove​(String categoryId)
        Removes a category from the categories of a PlannableOnCalendar. The category is specified by its unique identifier (its title for example). If the category isn't present, then nothing is done.
        Parameters:
        categoryId - the identifier of the category to remove.
      • removeAll

        public void removeAll​(List<String> categoryIds)
        Removes several categories from the categories of a PlannableOnCalendar. The categories are specified by their unique identifier (their title for example). If some of the categories to remove aren't present, then nothing is done with them.
        Parameters:
        categoryIds - the identifiers of the categories to remove.
      • remove

        public void remove​(String... categoryIds)
        Removes one or several categories from the categories of a PlannableOnCalendar. The categories are specified by their unique identifier (their title for example). If some of the categories to remove aren't present, then nothing is done with them.
        Parameters:
        categoryIds - the identifiers of the categories to remove.
      • asList

        public List<String> asList()
        Converts this categories container to a list of category identifiers.
        Returns:
        a list of category identifiers.
      • asArray

        public String[] asArray()
        Converts this categories container to an array of category identifiers.
        Returns:
        an array of category identifiers.
      • contains

        public boolean contains​(String category)
        Is the specified category is in the categories of a PlannableOnCalendar.
        Parameters:
        category - a category identifier.
        Returns:
        true if the specified category is among the categories of a PlannableOnCalendar, false otherwise.
      • isEmpty

        public boolean isEmpty()
        Is there is no any categories set for a PlannableOnCalendar?
        Returns:
        true if no categories are set, false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • addAllFrom

        public void addAllFrom​(CategorySet categories)
        Adds to this categories all those from the specified ones.
        Parameters:
        categories - the categories to add.
      • copy

        public CategorySet copy()
        Copies this object into another CategorySet instance.
        Returns:
        a copy of this object.