Package muntjac :: Package data :: Module container :: Class IOrdered
[hide private]
[frames] | no frames]

Class IOrdered

source code

object --+    
         |    
IContainer --+
             |
            IOrdered
Known Subclasses:

Interface for IContainer classes whose Items can be traversed in order.

If the container is filtered or sorted, the traversal applies to the filtered and sorted view.

The addItemAfter() methods should apply filters to the added item after inserting it, possibly hiding it immediately. If the container is being sorted, they may add items at the correct sorted position instead of the given position. See also IFilterable and ISortable for more information.

Instance Methods [hide private]
 
addItemAfter(self, previousItemId, newItemId=None)
Adds a new item after the given item.
source code
 
firstItemId(self)
Gets the ID of the first Item in the IContainer.
source code
 
isFirstId(self, itemId)
Tests if the Item corresponding to the given Item ID is the first Item in the IContainer.
source code
 
isLastId(self, itemId)
Tests if the Item corresponding to the given Item ID is the last Item in the IContainer.
source code
 
lastItemId(self)
Gets the ID of the last Item in the IContainer..
source code
 
nextItemId(self, itemId)
Gets the ID of the Item following the Item that corresponds to itemId.
source code
 
prevItemId(self, itemId)
Gets the ID of the Item preceding the Item that corresponds to itemId.
source code

Inherited from IContainer: addContainerProperty, addItem, containsId, getContainerProperty, getContainerPropertyIds, getItem, getItemIds, getType, removeAllItems, removeContainerProperty, removeItem, size

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

addItemAfter(self, previousItemId, newItemId=None)

source code 

Adds a new item after the given item.

Adding an item after null item adds the item as first item of the ordered container.

Parameters:
  • previousItemId - Id of the visible item in ordered container after which to insert the new item.
  • newItemId - Id of the new item to be added.
Returns:
new item or null if the operation fails.
Raises:
  • NotImplementedError - if the operation is not supported by the container

See Also: IOrdered for adding items in filtered or sorted containers

firstItemId(self)

source code 

Gets the ID of the first Item in the IContainer.

Returns:
ID of the first visible Item in the IContainer

isFirstId(self, itemId)

source code 

Tests if the Item corresponding to the given Item ID is the first Item in the IContainer.

Parameters:
  • itemId - ID of an Item in the IContainer
Returns:
True if the Item is first visible item in the IContainer, False if not

isLastId(self, itemId)

source code 

Tests if the Item corresponding to the given Item ID is the last Item in the IContainer.

Returns:
True if the Item is last visible item in the IContainer, False if not

lastItemId(self)

source code 

Gets the ID of the last Item in the IContainer..

Returns:
ID of the last visible Item in the IContainer

nextItemId(self, itemId)

source code 

Gets the ID of the Item following the Item that corresponds to itemId. If the given Item is the last or not found in the IContainer, None is returned.

Parameters:
  • itemId - ID of a visible Item in the IContainer
Returns:
ID of the next visible Item or None

prevItemId(self, itemId)

source code 

Gets the ID of the Item preceding the Item that corresponds to itemId. If the given Item is the first or not found in the IContainer, None is returned.

Parameters:
  • itemId - ID of a visible Item in the IContainer
Returns:
ID of the previous visible Item or None