Home | Trees | Indices | Help |
|
---|
|
object --+ | container.IContainer --+ | abstract_container.AbstractContainer --+ | object --+ | | | container.IItemSetChangeNotifier --+ | object --+ | | | container.IContainer --+ | | | container.IOrdered --+ | | | container.IIndexed --+ | AbstractInMemoryContainer
Abstract IContainer
class that handles
common functionality for in-memory containers. Concrete in-memory
container classes can either inherit this class, inherit AbstractContainer, or implement the IContainer
interface directly.
Adding and removing items (if desired) must be implemented in subclasses by overriding the appropriate add*Item() and remove*Item() and removeAllItems() methods, calling the corresponding internalAddItemAfter, internalAddItemAt, internalAddItemAtEnd, internalRemoveItem and internalRemoveAllItems methods.
By default, adding and removing container properties is not supported, and subclasses need to implement getContainerPropertyIds. Optionally, subclasses can override addContainerProperty and removeContainerProperty to implement them.
Features:
Filterable
and SimpleFilterable
(internal implementation, does
not implement the interface directly)
To implement ISortable, subclasses need to implement getSortablePropertyIds and call the superclass method sortContainer in the method sort(object[],
bool[])
.
To implement IFilterable, subclasses need to implement the methods
Filterable.addContainerFilter
(calling addFilter), Filterable.removeAllContainerFilters
(calling removeAllFilters) and Filterable.removeContainerFilter
(calling removeFilter).
To implement ISimpleFilterable, subclasses also need to implement the
methods SimpleFilterable.addContainerFilter
and
SimpleFilterable.removeContainerFilters
calling
addFilter and removeFilters respectively.
<ITEMIDTYPE>: the class of item identifiers in the container, use object if can be any class
<PROPERTYIDCLASS>: the class of property identifiers for the items in the container, use Object if can be any class
<ITEMCLASS>: the (base) class of the Item instances in the
container, use Item
if unknown
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
Constructor for an abstract in-memory container.
|
Gets the Containers should not return Items that are filtered out.
|
Get an item even if filtered out. For internal use only. |
Gets the number of visible Items in the IContainer. Filtering can hide items so that they will not be visible through the container API.
|
Tests if the IContainer contains the specified Item. Filtering can hide items so that they will not be visible through the container API, and this method should respect visibility of items (i.e. only indicate visible items as being in the container) if feasible for the container.
|
Gets the ID's of all visible (after filtering and sorting) Items stored in the IContainer. The ID's cannot be modified through the returned collection. If the container is IOrdered, the collection returned by this method should follow that order. If the container is ISortable, the items should be in the sorted order. Calling this method for large lazy containers can be an expensive operation and should be avoided when practical.
|
Gets the ID of the Item following the Item that corresponds to
|
Gets the ID of the Item preceding the Item that corresponds to
|
Gets the ID of the first Item in the IContainer.
|
Gets the ID of the last Item in the IContainer..
|
Tests if the Item corresponding to the given Item ID is the first Item in the IContainer.
|
Tests if the Item corresponding to the given Item ID is the last Item in the IContainer.
|
Gets the ID of an Item by an index number.
|
Gets the index of the Item corresponding to the itemId. The following
is
|
Adds a new item at given index (in the filtered view). The indices of the item currently in the given position and all the following items are incremented. This method should apply filters to the added item after inserting it, possibly hiding it immediately. If the container is being sorted, the item may be added at the correct sorted position instead of the given position. See IIndexed, IOrdered, IFilterable and ISortable for more information.
|
Adds a new item after the given item. Adding an item after null item adds the item as first item of the ordered container.
|
Creates a new Item with the given ID in the IContainer. Creates a new
Item into the IContainer, and assign it an automatic ID if itemId is
The new Item is returned, and it is ready to have its Properties
modified. Returns
|
Removes the Item identified by Containers that support filtering should also allow removing an item that is currently filtered out. This functionality is optional.
|
Removes all Items from the IContainer. Note that Property ID and type information is preserved. This functionality is optional.
|
Adds a new Property to all Items in the IContainer. The Property ID, data type and default value of the new Property are given as parameters. This functionality is optional.
|
Removes a Property specified by the given Property ID from the IContainer. Note that the Property will be removed from all Items in the IContainer. This functionality is optional.
|
Implementation of the corresponding method in
|
|
Implementation of the corresponding method in
|
|
Filters the data in the container and updates internal data structures. This method should reset any internal data structures and then repopulate them so getItemIds and other methods only return the filtered items.
|
Checks if the given itemId passes the filters set for the container. The caller should make sure the itemId exists in the container. For non-existing itemIds the behaviour is undefined.
|
Adds a container filter and re-filter the view. The filter must implement Filter and its sub-filters (if any) must also be in-memory filterable. This can be used to implement Note that in some cases, incompatible filters cannot be detected when added and an UnsupportedFilterException may occur when performing filtering.
|
Remove a specific container filter and re-filter the view (if necessary). This can be used to implement |
Remove all container filters for all properties and re-filter the view. This can be used to implement |
Checks if there is a filter that applies to a given property.
|
Remove all container filters for a given property identifier and re-filter the view. This also removes filters applying to multiple properties including the one identified by propertyId. This can be used to implement
|
Returns the ItemSorter used for comparing items in a sort. See setItemSorter for more information.
|
Sets the ItemSorter used for comparing items in a sort. The
|
Sort base implementation to be used to implement ISortable. Subclasses should call this from a public See Also:
|
Perform the sorting of the data structures in the container. This is
invoked when the |
Returns the sortable property identifiers for the container. Can be
used to implement |
Removes all items from the internal data structures of this class. This can be used to implement removeAllItems in subclasses. No notification is sent, the caller has to fire a suitable item set change notification. |
Removes a single item from the internal data structures of this class. This can be used to implement removeItem in subclasses. No notification is sent, the caller has to fire a suitable item set change notification.
|
Adds the bean to all internal data structures at the given position. Fails if an item with itemId is already in the container. Returns a the item if it was added successfully, null otherwise. Caller should initiate filtering after calling this method. For internal use only - subclasses should use internalAddItemAtEnd, internalAddItemAt and internalAddItemAfter instead.
|
Add an item at the end of the container, and perform filtering if necessary. An event is fired if the filtered view changes.
|
Add an item after a given (visible) item, and perform filtering. An event is fired if the filtered view changes. The new item is added at the beginning if previousItemId is null.
|
Add an item at a given (visible after filtering) item index, and perform filtering. An event is fired if the filtered view changes.
|
Registers a new item as having been added to the container. This can involve storing the item or any relevant information about it in internal container-specific collections if necessary, as well as registering listeners etc. The full identifier list in AbstractInMemoryContainer has already been updated to reflect the new item when this method is called. |
Notify item set change listeners that an item has been added to the container. Unless subclasses specify otherwise, the default notification indicates a full refresh.
|
Notify item set change listeners that an item has been removed from the container. Unless subclasses specify otherwise, the default notification indicates a full refresh.
|
Returns the internal list of visible item identifiers after filtering. For internal use only. |
Returns true is the container has active filters.
|
Internal helper method to set the internal list of filtered item identifiers. Should not be used outside this class except for implementing clone(), may disappear from future versions. |
Internal helper method to get the internal list of filtered item identifiers. Should not be used outside this class except for implementing clone(), may disappear from future versions - use getVisibleItemIds in other contexts.
|
Internal helper method to set the internal list of all item identifiers. Should not be used outside this class except for implementing clone(), may disappear from future versions. |
Internal helper method to get the internal list of all item identifiers. Avoid using this method outside this class, may disappear in future versions.
|
Set the internal collection of filters without performing filtering. This method is mostly for internal use, use addFilter and |
Returns the internal collection of filters. The returned collection should not be modified by callers outside this class.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Apr 20 16:01:19 2013 | http://epydoc.sourceforge.net |