Collection.st
branchjv
changeset 17976 50c2416f962a
parent 17966 8b5df02e171f
child 17993 956342c369a2
equal deleted inserted replaced
17975:c3e4cd2a9637 17976:50c2416f962a
   257      Kludges around the stupid definition of OrderedCollection>>new:"
   257      Kludges around the stupid definition of OrderedCollection>>new:"
   258 
   258 
   259     ^ self withSize:n
   259     ^ self withSize:n
   260 ! !
   260 ! !
   261 
   261 
       
   262 
   262 !Collection class methodsFor:'Signal constants'!
   263 !Collection class methodsFor:'Signal constants'!
   263 
   264 
   264 emptyCollectionSignal
   265 emptyCollectionSignal
   265     "return the signal used to report non-allowed operation on empty collections"
   266     "return the signal used to report non-allowed operation on empty collections"
   266 
   267 
   492 
   493 
   493     ^ self keysAndValuesDo:[:key :index |
   494     ^ self keysAndValuesDo:[:key :index |
   494         aTwoArgBlock value:index value:key
   495         aTwoArgBlock value:index value:key
   495     ].
   496     ].
   496 ! !
   497 ! !
       
   498 
   497 
   499 
   498 !Collection methodsFor:'accessing'!
   500 !Collection methodsFor:'accessing'!
   499 
   501 
   500 anElement
   502 anElement
   501     "return any element from the collection, 
   503     "return any element from the collection, 
   868      #(1 2 3 4) copy addAll:#(5 6 7 8)
   870      #(1 2 3 4) copy addAll:#(5 6 7 8)
   869      #(1 2 3 4) asOrderedCollection addAll:#(5 6 7 8)
   871      #(1 2 3 4) asOrderedCollection addAll:#(5 6 7 8)
   870     "
   872     "
   871 
   873 
   872     "Modified: 12.4.1996 / 13:29:20 / cg"
   874     "Modified: 12.4.1996 / 13:29:20 / cg"
       
   875 !
       
   876 
       
   877 addAll:aCollectionOfObjects withOccurrences:anInteger
       
   878     "add each element from aCollection, anInteger times to the receiver.
       
   879      Returns the argument, aCollection (sigh)."
       
   880 
       
   881     aCollectionOfObjects do:[:each |
       
   882         self add:each withOccurrences:anInteger.
       
   883     ].
       
   884     ^ aCollectionOfObjects
       
   885 
       
   886     "Created: 11.5.1996 / 12:13:48 / cg"
   873 !
   887 !
   874 
   888 
   875 addAllFirst:aCollection
   889 addAllFirst:aCollection
   876     "insert all elements of the argument, aCollection at the beginning
   890     "insert all elements of the argument, aCollection at the beginning
   877      of the receiver. Returns the argument, aCollection."
   891      of the receiver. Returns the argument, aCollection."
  3188     "return a suitable size increment for growing.
  3202     "return a suitable size increment for growing.
  3189      The default returned here may be (and is) redefined in subclasses."
  3203      The default returned here may be (and is) redefined in subclasses."
  3190 
  3204 
  3191     ^ self size max:2
  3205     ^ self size max:2
  3192 ! !
  3206 ! !
       
  3207 
  3193 
  3208 
  3194 !Collection methodsFor:'operations'!
  3209 !Collection methodsFor:'operations'!
  3195 
  3210 
  3196 decrementAt:aKey
  3211 decrementAt:aKey
  3197     "decrement the value at aKey by one"
  3212     "decrement the value at aKey by one"
  4395 ! !
  4410 ! !
  4396 
  4411 
  4397 !Collection class methodsFor:'documentation'!
  4412 !Collection class methodsFor:'documentation'!
  4398 
  4413 
  4399 version
  4414 version
  4400     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.281 2012/08/21 12:49:44 cg Exp $'
  4415     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.282 2012/10/19 12:03:06 cg Exp $'
  4401 !
  4416 !
  4402 
  4417 
  4403 version_CVS
  4418 version_CVS
  4404     ^ '§Header: /cvs/stx/stx/libbasic/Collection.st,v 1.281 2012/08/21 12:49:44 cg Exp §'
  4419     ^ '§Header: /cvs/stx/stx/libbasic/Collection.st,v 1.282 2012/10/19 12:03:06 cg Exp §'
  4405 !
  4420 !
  4406 
  4421 
  4407 version_SVN
  4422 version_SVN
  4408     ^ '$Id: Collection.st 10844 2012-09-07 16:24:32Z vranyj1 $'
  4423     ^ '$Id: Collection.st 10858 2012-10-29 22:07:56Z vranyj1 $'
  4409 ! !
  4424 ! !
  4410 
  4425 
  4411 Collection initialize!
  4426 Collection initialize!