asLongIntegerArray
authorClaus Gittinger <cg@exept.de>
Wed, 03 Mar 2004 21:48:53 +0100
changeset 8050 11f3819291e3
parent 8049 ccd0e8f26439
child 8051 510f2dd4b771
asLongIntegerArray
Collection.st
--- a/Collection.st	Wed Mar 03 21:48:29 2004 +0100
+++ b/Collection.st	Wed Mar 03 21:48:53 2004 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: iso8859-1 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
               All Rights Reserved
@@ -1022,6 +1024,22 @@
     "Created: 14.2.1997 / 16:25:23 / cg"
 !
 
+asLongIntegerArray
+    "return a new LongIntegerArray with the collections elements
+     (which must convert to integers in the range 0..16rFFFFFFFF)."
+
+    |aLongWordArray 
+     index "{ Class: SmallInteger }" |
+
+    aLongWordArray := LongIntegerArray new:(self size).
+    index := 1.
+    self do:[:each |
+        aLongWordArray at:index put:each asInteger.
+        index := index + 1
+    ].
+    ^ aLongWordArray
+!
+
 asOrderedCollection
     "return a new OrderedCollection with the receiver collections elements"
 
@@ -2671,7 +2689,7 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.153 2004-02-11 14:04:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.154 2004-03-03 20:48:53 cg Exp $'
 ! !
 
 Collection initialize!