--- a/StringCollection.st Fri Nov 24 21:48:43 1995 +0100
+++ b/StringCollection.st Fri Nov 24 21:55:31 1995 +0100
@@ -10,7 +10,7 @@
hereby transferred.
"
-VariableArray subclass:#StringCollection
+OrderedCollection subclass:#StringCollection
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
@@ -48,6 +48,12 @@
!StringCollection class methodsFor:'instance creation'!
+new:size
+ "return a new string collection with size empty lines"
+
+ ^ (super new:size) grow:size
+!
+
from:aString
"return a new text object with lines taken from the argument, aString"
@@ -116,33 +122,6 @@
]
! !
-!StringCollection methodsFor:'growing'!
-
-add:aString
- "append the argument, aString to myself -
- we increase physical size by 50 to avoid lots of copying around"
-
- |oldSize "{ Class:SmallInteger }"|
-
- oldSize := tally.
- super grow:(oldSize + 50).
- tally := oldSize + 1.
- contentsArray at:tally put:aString
-!
-
-grow:newSize
- "grow to newsize - new elements are initialized with empty strings -
- not nil"
-
- |oldSize "{ Class:SmallInteger }"|
-
- oldSize := tally.
- super grow:newSize.
- (oldSize < newSize) ifTrue:[
- contentsArray from:(oldSize + 1) to:newSize put:''
- ]
-! !
-
!StringCollection methodsFor:'printing'!
printString
@@ -171,5 +150,5 @@
!StringCollection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.19 1995-11-23 17:28:32 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.20 1995-11-24 20:55:31 cg Exp $'
! !