Collection.st
changeset 21040 9f1f81cbf2b2
parent 20791 f2ac9a12c878
child 21042 edb2e7f82c62
child 21082 c8e0ef40bf6e
equal deleted inserted replaced
21039:49823ec25298 21040:9f1f81cbf2b2
   255         addAll:aCollection;
   255         addAll:aCollection;
   256         yourself.
   256         yourself.
   257 !
   257 !
   258 
   258 
   259 withSize:n
   259 withSize:n
   260     "obsolete: please use newWithSize:, for its better name
   260     "obsolete: please use newWithSize:, for its better name"
   261      Return a new collection which really provides space for n elements.
   261 
   262      Kludges around the stupid definition of OrderedCollection>>new:"
   262     <resource: #obsolete>
   263 
   263 
   264     ^ self newWithSize:n
   264     ^ self newWithSize:n
   265 ! !
   265 ! !
   266 
   266 
   267 !Collection class methodsFor:'Compatibility-Squeak'!
   267 !Collection class methodsFor:'Compatibility-Squeak'!
   270     "return a new collection which really provides space for n elements.
   270     "return a new collection which really provides space for n elements.
   271      Kludges around the stupid definition of OrderedCollection>>new:"
   271      Kludges around the stupid definition of OrderedCollection>>new:"
   272 
   272 
   273     ^ self newWithSize:n
   273     ^ self newWithSize:n
   274 ! !
   274 ! !
       
   275 
   275 
   276 
   276 !Collection class methodsFor:'Signal constants'!
   277 !Collection class methodsFor:'Signal constants'!
   277 
   278 
   278 emptyCollectionSignal
   279 emptyCollectionSignal
   279     "return the signal used to report non-allowed operation on empty collections"
   280     "return the signal used to report non-allowed operation on empty collections"
   544     
   545     
   545     ^ self intersect:aCollection
   546     ^ self intersect:aCollection
   546 
   547 
   547     "Created: / 22-10-2008 / 21:29:27 / cg"
   548     "Created: / 22-10-2008 / 21:29:27 / cg"
   548 ! !
   549 ! !
       
   550 
   549 
   551 
   550 !Collection methodsFor:'accessing'!
   552 !Collection methodsFor:'accessing'!
   551 
   553 
   552 anElement
   554 anElement
   553     "return any element from the collection, 
   555     "return any element from the collection, 
  5995     "dispatch for visitor pattern; send #visitCollection:with: to aVisitor"
  5997     "dispatch for visitor pattern; send #visitCollection:with: to aVisitor"
  5996 
  5998 
  5997     ^ aVisitor visitCollection:self with:aParameter
  5999     ^ aVisitor visitCollection:self with:aParameter
  5998 ! !
  6000 ! !
  5999 
  6001 
       
  6002 
  6000 !Collection class methodsFor:'documentation'!
  6003 !Collection class methodsFor:'documentation'!
  6001 
  6004 
  6002 version
  6005 version
  6003     ^ '$Header$'
  6006     ^ '$Header$'
  6004 !
  6007 !