<<<<<<<<<<<<<<<<<

sorted_collection(lymb) Core Classes sorted_collection(lymb)

NAME

sorted_collection

SUPERCLASS

collection

DESCRIPTION

Sorted_collection adds some ordering behavior to the collection class.

INSTANCE VARIABLES

No new instance variables are defined.

MESSAGES

ascending: message treats each member of the collection as an object, sends it message and uses the string value returned in the comparison to sort the collection in ascending order.

descending: message treats each member of the collection as an object, sends it message and uses the string value returned in the comparison to sort the collection in descending order.

sort: message treats each member of the collection as an object, sends it message and uses the string value returned in the comparison to sort the collection in ascending order.

ascending_string_sort! sorts the names in the collection in ascending order. They do not have to be names of objects.

descending_string_sort! sorts the names in the collection in descending order. They do not have to be names of objects.

string_sort! sorts the names in the collection in ascending order. They do not have to be names of objects.

unique! removes adjacent duplicate entries in the collection.

EXAMPLE

sorted_collection new: c members=(a, b); string new: a = `good year'; string new: b = `1992'; c sort: `value?' print:members; -- prints b, then a c string_sort! print:members; -- prints a, then b

SEE ALSO

collection


Please send comments and suggestions to
consult@rpi.edu