Collection.st
changeset 9073 cb81da1b2ad5
parent 9065 f77c6f153df7
child 9076 e7957fd220c8
--- a/Collection.st	Tue Jan 24 12:08:47 2006 +0100
+++ b/Collection.st	Tue Jan 24 12:14:54 2006 +0100
@@ -518,6 +518,16 @@
     "Created: 6.2.1996 / 15:27:49 / cg"
 !
 
+median
+    "Return the middle element, or as close as we can get."
+
+    ^ self asSortedCollection median
+
+    "
+     #(10 35 20 45 30 5) median
+    "
+!
+
 nth:n
     "return the nth element of the collection.
      For unordered collections, this simply returns the nth
@@ -2866,7 +2876,7 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.179 2006-01-23 21:21:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.180 2006-01-24 11:14:54 cg Exp $'
 ! !
 
 Collection initialize!