Next: Stream, Previous: AssociativeArray, Up: Classes [Index]
SortedList
Class+=
(Object
obj1, ...)
Add the items given in the argument to the receiver list. For example:
int main () { SortedList new l; l = "first", "second", "third", "fourth"; l += "fifth", "sixth", "seventh", "eighth"; l map { printf ("%s\n", self); } }
=
(Object
obj1, ...)
Push the arguments on to the receiver list. The arguments are a comma separated list of objects. For example:
int main () { SortedList new l; l = "first", "second", "third", "fourth"; l map { printf ("%s\n", self); } }
The =
method initializes a list with only the objects that are
given as arguments. The memthod deletes any previous list contents.
append
(Object
obj1, ...)
Add the objects given in the argument to the receiver list.
This is a synonym for the +=
method, above.
init
(Object
obj1, ...)
This is a synonym for the =
method, above.
pushAscending (Object
new_item)
pushDescending (Object
new_item)
Adds new_item to the receiver list at the point where its value maintains the receiver list items’ ascending or descending sort order.