1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """An item comparator which is compatible with the ISortable interface."""
17
18
20 """An item comparator which is compatible with the L{ISortable} interface.
21 The C{IItemSorter} interface can be used in C{Sortable} implementations
22 to provide a custom sorting method.
23 """
24
26 """Sets the parameters for an upcoming sort operation. The parameters
27 determine what container to sort and how the C{IItemSorter} sorts the
28 container.
29
30 @param container:
31 The container that will be sorted. The container must
32 contain the propertyIds given in the C{propertyId}
33 parameter.
34 @param propertyId:
35 The property ids used for sorting. The property ids must
36 exist in the container and should only be used if they are
37 also sortable, i.e include in the collection returned by
38 C{container.getSortableContainerPropertyIds()}. See
39 L{ISortable.sort} for more information.
40 @param ascending:
41 Sorting order flags for each property id. See
42 L{ISortable.sort} for more information.
43 """
44 raise NotImplementedError
45
46
47 - def compare(self, itemId1, itemId2):
48 """Compares its two arguments for order. Returns a negative integer,
49 zero, or a positive integer as the first argument is less than, equal
50 to, or greater than the second.
51
52 The parameters for the C{IItemSorter} C{compare()} method must always
53 be item ids which exist in the container set using L{setSortProperties}.
54
55 @see: L{IComparator.compare}
56 """
57 raise NotImplementedError
58