Package Modeling :: Module SortOrdering :: Class SortOrdering
[show private | hide private]
[frames | no frames]

Class SortOrdering


The canonical sorting command has a key and an operator. The key is the name of the attribute to use for sorting objects, the operator is the sorting order (e.g. ascending, descending). Note: the key is in fact more general than simply the name of an, attribute, since objects' values are accessed through L{KeyValueCoding} --see L{sortedArrayUsingKeyOrderArray}.
Method Summary
  __init__(self, key, operator)
  key(self)
  operator(self)
  sortedArrayUsingKeyOrderArray(array, sortOrderings)
Sorts array with respect to the list of sort commands supplied in sortOrderings. (Static method)
  sortOrderingWithKey(key, operator)
Alternate constructor for a L{SortOrdering} (Static method)

Class Variable Summary
tuple __implements__ = (<class Modeling.interfaces.SortOrderin...

Static Method Details

sortedArrayUsingKeyOrderArray(array, sortOrderings)

Sorts array with respect to the list of sort commands supplied in sortOrderings. Object's values are accessed using L{SortOrdering}.key and L{KeyValueCoding.valueForKeyPath}.

@parameter array: a sequence of objects implementing
L{KeyValueCoding.KeyValueCoding.valueForKeyPath}

@parameter sortOrderings: a sequence of L{SortOrdering} commands.

@return: the sorted array

sortOrderingWithKey(key, operator)

Alternate constructor for a L{SortOrdering}

Class Variable Details

__implements__

Type:
tuple
Value:
(<class Modeling.interfaces.SortOrdering.SortOrderingInterface at 0xb6\
a3aadc>,)                                                              

Generated by Epydoc 2.1 on Sat Mar 4 13:36:23 2006 http://epydoc.sf.net