/** * Add a categorygroup. * * @param group * category group to be added */ public void addCategoryGroup(final CategoryGroup group) { try { getWriteLock().lock(); m_config.addCategoryGroup(group); } finally { getWriteLock().unlock(); } }
/** * Delete a categorygroup. * * @param groupname * category group to be removed * @return true if categorygroup is successfully deleted */ public boolean deleteCategoryGroup(final String groupname) { try { getWriteLock().lock(); return m_config.removeCategoryGroup(groupname); } finally { getWriteLock().unlock(); } }
/** * Delete a categorygroup. * * @param group * category group to be removed * @return true if categorygroup is successfully deleted */ public boolean deleteCategoryGroup(final CategoryGroup group) { try { getWriteLock().lock(); return m_config.removeCategoryGroup(group); } finally { getWriteLock().unlock(); } }
/** * Replace category in a categorygroup. * * @param groupname * category group to which category is to be added * @param cat * category to be replaced * @return true if category is successfully replaced in the specified * category group */ public boolean replaceCategory(final String groupname, final Category cat) { try { getWriteLock().lock(); m_config.replaceCategoryInGroup(groupname, cat); } finally { getWriteLock().unlock(); } return false; }
/** * Add category to a categorygroup. * * @param groupname * category group to which category is to be added * @param cat * category to be added * @return true if category is successfully added to the specified category * group */ public boolean addCategory(final String groupname, final Category cat) { try { getWriteLock().lock(); for (final CategoryGroup cg : m_config.getCategoryGroups()) { if (cg.getName().equals(groupname)) { cg.addCategory(cat); return true; } } } finally { getWriteLock().unlock(); } return false; }
/** * Delete category from a categorygroup. * * @param groupname * category group from which category is to be removed * @param catlabel * label of the category to be deleted * @return true if category is successfully deleted from the specified * category group */ public boolean deleteCategory(final String groupname, final String catlabel) { try { getWriteLock().lock(); for (final CategoryGroup cg : m_config.getCategoryGroups()) { if (cg.getName().equals(groupname)) { cg.removeCategory(catlabel); } } } finally { getWriteLock().unlock(); } return false; }
/** * Delete category from a categorygroup. * * @param groupname * category group from which category is to be removed * @param cat * category to be deleted * @return true if category is successfully deleted from the specified * category group */ public boolean deleteCategory(final String groupname, final Category cat) { try { getWriteLock().lock(); for (final CategoryGroup cg : m_config.getCategoryGroups()) { if (cg.getName().equals(groupname)) { cg.removeCategory(cat); return true; } } } finally { getWriteLock().unlock(); } return false; }
/** * Replace categorygroup. * * @param group * category group to be replaced * @return true if categorygroup is successfully replaced */ public boolean replaceCategoryGroup(final CategoryGroup group) { try { getWriteLock().lock(); final String groupname = group.getName(); for (int i = 0; i < m_config.getCategoryGroups().size(); i++) { final int index1 = i; final CategoryGroup oldCg = m_config.getCategoryGroups().get(index1); if (oldCg.getName().equals(groupname)) { final int index = i; m_config.getCategoryGroups().set(index, group); return true; } } } finally { getWriteLock().unlock(); } return false; }