*** empty log message ***
authorca
Fri, 06 Feb 2004 19:17:54 +0100
changeset 7885 e206ad1767bd
parent 7884 a164a1259744
child 7886 e2f993f0fbf5
*** empty log message ***
Collection.st
--- a/Collection.st	Fri Feb 06 14:19:03 2004 +0100
+++ b/Collection.st	Fri Feb 06 19:17:54 2004 +0100
@@ -1186,6 +1186,22 @@
     ^ self asStringCollection
 !
 
+asWordArray
+    "return a new WordArray with the collections elements
+     (which must convert to integers in the range 0..16rFFFF)."
+
+    |aWordArray 
+     index "{ Class: SmallInteger }" |
+
+    aWordArray := WordArray new:(self size).
+    index := 1.
+    self do:[:each |
+        aWordArray at:index put:each asInteger.
+        index := index + 1
+    ].
+    ^ aWordArray
+!
+
 readStream
     "return a stream for reading from the receiver"
 
@@ -2627,7 +2643,7 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.150 2004-01-07 12:50:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.151 2004-02-06 18:17:54 ca Exp $'
 ! !
 
 Collection initialize!