Package muntjac :: Package data :: Package util :: Module item_sorter :: Class IItemSorter
[hide private]
[frames] | no frames]

Class IItemSorter

source code

object --+
         |
        IItemSorter
Known Subclasses:

An item comparator which is compatible with the ISortable interface. The IItemSorter interface can be used in Sortable implementations to provide a custom sorting method.

Instance Methods [hide private]
 
setSortProperties(self, container, propertyId, ascending)
Sets the parameters for an upcoming sort operation.
source code
 
compare(self, itemId1, itemId2)
Compares its two arguments for order.
source code

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]

setSortProperties(self, container, propertyId, ascending)

source code 

Sets the parameters for an upcoming sort operation. The parameters determine what container to sort and how the IItemSorter sorts the container.

Parameters:
  • container - The container that will be sorted. The container must contain the propertyIds given in the propertyId parameter.
  • propertyId - The property ids used for sorting. The property ids must exist in the container and should only be used if they are also sortable, i.e include in the collection returned by container.getSortableContainerPropertyIds(). See ISortable.sort for more information.
  • ascending - Sorting order flags for each property id. See ISortable.sort for more information.

compare(self, itemId1, itemId2)

source code 

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The parameters for the IItemSorter compare() method must always be item ids which exist in the container set using setSortProperties.

See Also: IComparator.compare