Collection.st
branchjv
changeset 17892 d86c8bd5ece3
parent 17869 9610c6c94e71
child 17907 998195c96a6d
--- a/Collection.st	Fri Oct 28 08:45:38 2011 +0100
+++ b/Collection.st	Mon Oct 31 22:19:21 2011 +0000
@@ -607,12 +607,12 @@
     coll := OrderedCollection new.
     remain := n.    
     self do:[:e | 
-                coll add:e.
-                remain := remain - 1.
-                remain == 0 ifTrue:[
-                    ^ coll
-                ].
-            ].
+        coll add:e.
+        remain := remain - 1.
+        remain == 0 ifTrue:[
+            ^ coll
+        ].
+    ].
 
     "error if collection has not enough elements"
     ^ self notEnoughElementsError
@@ -621,6 +621,8 @@
      #(1 2 3 4 5) first:3           
      #(1 2 3 4 5) asSet first:3           
     "
+
+    "Modified (format): / 29-09-2011 / 10:16:49 / cg"
 !
 
 firstIfEmpty:exceptionValue
@@ -688,13 +690,13 @@
     coll := OrderedCollection new:n.
     remain := n.    
     self do:[:e | 
-                remain > 0 ifTrue:[
-                    remain := remain - 1.
-                ] ifFalse:[
-                    coll removeFirst.
-                ].
-                coll add:e.
-            ].
+        remain > 0 ifTrue:[
+            remain := remain - 1.
+        ] ifFalse:[
+            coll removeFirst.
+        ].
+        coll add:e.
+    ].
 
     remain ~~ 0 ifTrue:[
         "error if collection has not enough elements"
@@ -707,6 +709,8 @@
      #(1 2 3 4 5 6 7 8 9 0) asSet last:3           
      'hello world' last:5           
     "
+
+    "Modified (format): / 29-09-2011 / 10:16:22 / cg"
 !
 
 lastIfEmpty:exceptionValue
@@ -812,10 +816,11 @@
 
     ^ self nth:3
 
-
     "
      #(1 2 3) third
     "
+
+    "Modified (format): / 29-09-2011 / 10:17:25 / cg"
 !
 
 values
@@ -1536,6 +1541,15 @@
     ^ SharedCollection for:self.
 !
 
+asSignedIntegerArray
+    "return a new SignedIntegerArray with the collection's elements
+     (which must convert to 32bit signed integers in the range -16r80000000..16r7FFFFFFF)."
+
+    ^ self asIntegerArray:SignedIntegerArray
+
+    "Created: / 07-10-2011 / 13:14:01 / cg"
+!
+
 asSortedCollection
     "return a new SortedCollection with the receiver collections elements"
 
@@ -4112,15 +4126,16 @@
 !Collection class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Collection.st 10700 2011-09-29 15:44:37Z vranyj1 $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.267 2011/10/07 11:14:09 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Collection.st,v 1.265 2011/09/14 16:40:49 cg Exp §'
+    ^ 'Header: /cvs/stx/stx/libbasic/Collection.st,v 1.267 2011/10/07 11:14:09 cg Exp '
 !
 
 version_SVN
-    ^ '$Id: Collection.st 10700 2011-09-29 15:44:37Z vranyj1 $'
+    ^ '$Id: Collection.st 10729 2011-10-31 22:19:21Z vranyj1 $'
 ! !
 
 Collection initialize!
+