--- a/OrdColl.st Thu May 06 21:14:18 1999 +0200
+++ b/OrdColl.st Sat May 08 14:52:11 1999 +0200
@@ -989,12 +989,20 @@
asArray
"return the receiver as an array."
- |newArray sz|
+ ^ contentsArray copyFrom:firstIndex to:lastIndex
- sz := self size.
- newArray := Array new:sz.
- newArray replaceFrom:1 to:sz with:contentsArray startingAt:firstIndex.
- ^ newArray
+"/ |newArray sz|
+"/
+"/ sz := self size.
+"/ newArray := Array new:sz.
+"/ newArray replaceFrom:1 to:sz with:contentsArray startingAt:firstIndex.
+"/ ^ newArray
+
+ "
+ OrderedCollection new asArray
+ OrderedCollection new add:1;add:2;asArray
+ OrderedCollection new add:1;removeFirst;asArray
+ "
"
|o rnd|
@@ -1625,10 +1633,18 @@
!OrderedCollection methodsFor:'private accessing'!
contentsArray
+ "return the orderedCollections underlying contentsArray.
+ The actual elements are found here starting at firstIndex,
+ and ending at lastIndex."
+
^ contentsArray
!
firstIndex
+ "return the index of my first element in my underlying contentsArray.
+ The actual elements are found starting this index,
+ and ending at lastIndex."
+
^ firstIndex
! !
@@ -1775,5 +1791,5 @@
!OrderedCollection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/OrdColl.st,v 1.70 1999-03-19 20:47:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/OrdColl.st,v 1.71 1999-05-08 12:52:11 cg Exp $'
! !
--- a/OrderedCollection.st Thu May 06 21:14:18 1999 +0200
+++ b/OrderedCollection.st Sat May 08 14:52:11 1999 +0200
@@ -989,12 +989,20 @@
asArray
"return the receiver as an array."
- |newArray sz|
+ ^ contentsArray copyFrom:firstIndex to:lastIndex
- sz := self size.
- newArray := Array new:sz.
- newArray replaceFrom:1 to:sz with:contentsArray startingAt:firstIndex.
- ^ newArray
+"/ |newArray sz|
+"/
+"/ sz := self size.
+"/ newArray := Array new:sz.
+"/ newArray replaceFrom:1 to:sz with:contentsArray startingAt:firstIndex.
+"/ ^ newArray
+
+ "
+ OrderedCollection new asArray
+ OrderedCollection new add:1;add:2;asArray
+ OrderedCollection new add:1;removeFirst;asArray
+ "
"
|o rnd|
@@ -1625,10 +1633,18 @@
!OrderedCollection methodsFor:'private accessing'!
contentsArray
+ "return the orderedCollections underlying contentsArray.
+ The actual elements are found here starting at firstIndex,
+ and ending at lastIndex."
+
^ contentsArray
!
firstIndex
+ "return the index of my first element in my underlying contentsArray.
+ The actual elements are found starting this index,
+ and ending at lastIndex."
+
^ firstIndex
! !
@@ -1775,5 +1791,5 @@
!OrderedCollection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.70 1999-03-19 20:47:30 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/OrderedCollection.st,v 1.71 1999-05-08 12:52:11 cg Exp $'
! !