com.miginfocom.calendar.category
Interface Categorizable

All Known Subinterfaces:
Activity, ActivityView
All Known Implementing Classes:
AbstractActivity, AbstractActivityView, DefaultActivity, DefaultActivityView

public interface Categorizable

Denotes that the object can link to one or more categories.


Method Summary
 void addCategoryID(java.lang.Object catID, int index)
          Adds a category to the category list.
 java.lang.Object[] getCategoryIDs()
          Returns the categories that this object is linked to.
 boolean isCategory(java.lang.Object id)
          Returns if id is one of the id:s that this categorizable has.
 void removeCategoryID(java.lang.Object catID)
          Removes a category from the category list.
 void setCategoryIDs(java.lang.Object[] catIds)
          Sets the IDs of the categories that this activity should belong to or an empty array if none.
 

Method Detail

setCategoryIDs

void setCategoryIDs(java.lang.Object[] catIds)
Sets the IDs of the categories that this activity should belong to or an empty array if none. Never null.

Parameters:
catIds - The IDs of the categories that this activity should belong to or an empty array if none. May be null and with length 0.

getCategoryIDs

java.lang.Object[] getCategoryIDs()
Returns the categories that this object is linked to.

Returns:
The categories that this object is linked to. May be null and with length 0.

isCategory

boolean isCategory(java.lang.Object id)
Returns if id is one of the id:s that this categorizable has.

Parameters:
id - The id to check.
Returns:
If id is one of the id:s that this categorizable has.

addCategoryID

void addCategoryID(java.lang.Object catID,
                   int index)
Adds a category to the category list. If catID already exists for this object, nothing is changed.
Will remake an array every time. I.e. optimized for retrieval of the categories, not insertion.

Parameters:
catID - The ID of the categories that this activity should also belong to. Not null.
index - The index at which to add the category id. It might be important since category IDs earlier in the array will sometimes hide latter ones, such as for category overrides.

index is lenient in the upper range. It is legal to set a very high value (e.g. MigUtil.BIG_INT to be sure it will be added last. 0 will add it first. It should not be negative though.


removeCategoryID

void removeCategoryID(java.lang.Object catID)
Removes a category from the category list. If catID don't exist for this object, nothing is changed.

Will normally remake a new array every time. I.e. optimized for retrieval of the categories, not removal.

Parameters:
catID - The ID of the categories that this activity should no longer belong to. Not null.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.