Sorted group list. This is a list that simply displays its members in a specific sorting order.

class ListGroupSorted :   ListGroup

Superclass Tree   (in declaration order)


Subclass Tree  


Global Objects  


Summary of Properties  

Inherited from ListGroup :
groupDisplaysSublist  minGroupSize 

Summary of Methods  

compareGroupItems  showGroupList  sortListGroup 

Inherited from ListGroup :
createGroupSublister  groupCardinality  groupNounPhraseCount  showGroupItem  showGroupItemCounted 




// compareGroupItems (a, b)Interface description onlylister.t[2104]

Compare a pair of items from the group to determine their relative sorting order. This should return 0 if the two items are at the same sorting order, a positive integer if the first item sorts after the second item, or a negative integer if the first item sorts before the second item.

Note that we don't care about the return value beyond whether it's positive, negative, or zero. This makes it especially easy to implement this method if the sorting order is determined by a property on each object that has an integer value: in this case you simply return the difference of the two property values, as in a.prop - b.prop. This will have the effect of sorting the objects in ascending order of their 'prop' property values. To sort in descending order of the same property, simply reverse the subtraction: b.prop - a.prop.

When no implementation of this method is defined in the group object, sortListGroup won't bother sorting the list at all.

By default, we don't implement this method. Subclasses that want to impose a sorting order must implement the method.

showGroupList (pov, lister, lst, options, indent, infoTab)OVERRIDDENlister.t[2051]
Show the group list

sortListGroup (lst)lister.t[2069]
Sort the group list. By default, if we have a compareGroupItems() method defined, we'll sort the list using that method; otherwise, we'll just return the list unchanged.

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3