Collection.st
changeset 14614 6b02772b261d
parent 14608 24efca93868b
child 14696 2d48fceee3fa
child 18011 deb0c3355881
equal deleted inserted replaced
14613:a263aaa13092 14614:6b02772b261d
  1610     aSortedCollection addAll:self.
  1610     aSortedCollection addAll:self.
  1611     ^ aSortedCollection
  1611     ^ aSortedCollection
  1612 !
  1612 !
  1613 
  1613 
  1614 asSortedStrings
  1614 asSortedStrings
  1615     "Create & return a SortedCollection that sorts the receivers
  1615     "Create & return a SortedCollection that sorts the receiver's
  1616      elements according to the locales collating policy.
  1616      elements according to the locales collating policy.
  1617      This is currently not really support - strings are sorted
  1617      This is currently not really support - strings are sorted
  1618      without caring for the locale."
  1618      without caring for the locale."
  1619 
  1619 
  1620     |aSortedCollection|
  1620     |aSortedCollection|
  1626     "Created: 13.9.1997 / 09:36:22 / cg"
  1626     "Created: 13.9.1997 / 09:36:22 / cg"
  1627     "Modified: 13.9.1997 / 09:43:00 / cg"
  1627     "Modified: 13.9.1997 / 09:43:00 / cg"
  1628 !
  1628 !
  1629 
  1629 
  1630 asSortedStrings:sortBlock
  1630 asSortedStrings:sortBlock
  1631     "Create & return a SortedCollection that sorts the receivers
  1631     "Create & return a SortedCollection that sorts the receiver's
  1632      elements using sortBlock and according to the locales collating policy,
  1632      elements using sortBlock and according to the locales collating policy,
  1633      which is passed as first arg to sortBlock.
  1633      which is passed as first arg to sortBlock.
  1634      This is currently not really support - strings are sorted
  1634      This is currently not really support - strings are sorted
  1635      without caring for the locale."
  1635      without caring for the locale."
  1636 
  1636 
  1644     "Created: / 13.9.1997 / 09:36:45 / cg"
  1644     "Created: / 13.9.1997 / 09:36:45 / cg"
  1645     "Modified: / 27.10.1997 / 16:39:48 / cg"
  1645     "Modified: / 27.10.1997 / 16:39:48 / cg"
  1646 !
  1646 !
  1647 
  1647 
  1648 asSortedStrings:sortBlock with:aCollationPolicy
  1648 asSortedStrings:sortBlock with:aCollationPolicy
  1649     "Create & return a SortedCollection that sorts the receivers
  1649     "Create & return a SortedCollection that sorts the receiver's
  1650      elements using sortBlock and according to the specified locales collating policy.
  1650      elements using sortBlock and according to the specified locales collating policy.
  1651      This is currently not really support - strings are sorted
  1651      This is currently not really support - strings are sorted
  1652      without caring for the locale."
  1652      without caring for the locale."
  1653 
  1653 
  1654     |aSortedCollection|
  1654     |aSortedCollection|
  1661     "Created: 13.9.1997 / 09:37:21 / cg"
  1661     "Created: 13.9.1997 / 09:37:21 / cg"
  1662     "Modified: 13.9.1997 / 09:45:27 / cg"
  1662     "Modified: 13.9.1997 / 09:45:27 / cg"
  1663 !
  1663 !
  1664 
  1664 
  1665 asSortedStringsWith: aCollationPolicy
  1665 asSortedStringsWith: aCollationPolicy
  1666     "Create & return a SortedCollection that sorts the receivers
  1666     "Create & return a SortedCollection that sorts the receiver's
  1667      elements according to the specified locales collating policy.
  1667      elements according to the specified locales collating policy.
  1668      This is currently not really support - strings are sorted
  1668      This is currently not really support - strings are sorted
  1669      without caring for the locale."
  1669      without caring for the locale."
  1670 
  1670 
  1671     |aSortedCollection|
  1671     |aSortedCollection|
  3234 
  3234 
  3235     self grow:(self size + self growSize)
  3235     self grow:(self size + self growSize)
  3236 !
  3236 !
  3237 
  3237 
  3238 grow:howBig
  3238 grow:howBig
  3239     "change the receivers size"
  3239     "change the receiver's size"
  3240 
  3240 
  3241     ^ self subclassResponsibility
  3241     ^ self subclassResponsibility
  3242 !
  3242 !
  3243 
  3243 
  3244 growSize
  3244 growSize
  4292 
  4292 
  4293     ^ self size == 0
  4293     ^ self size == 0
  4294 !
  4294 !
  4295 
  4295 
  4296 isEmptyOrNil
  4296 isEmptyOrNil
  4297     "return true if I am nil or an empty collection - true here, if the receivers size is 0,
  4297     "return true if I am nil or an empty collection - true here, if the receiver's size is 0,
  4298      (from Sqeak)"
  4298      (from Squeak)"
  4299 
  4299 
  4300     ^ self isEmpty
  4300     ^ self isEmpty
  4301 
  4301 
  4302     "Created: / 13.11.2001 / 13:17:12 / cg"
  4302     "Created: / 13.11.2001 / 13:17:12 / cg"
  4303     "Modified: / 13.11.2001 / 13:28:35 / cg"
  4303     "Modified: / 13.11.2001 / 13:28:35 / cg"
  4453 ! !
  4453 ! !
  4454 
  4454 
  4455 !Collection class methodsFor:'documentation'!
  4455 !Collection class methodsFor:'documentation'!
  4456 
  4456 
  4457 version
  4457 version
  4458     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.285 2012-12-19 09:24:31 stefan Exp $'
  4458     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.286 2012-12-21 11:58:02 cg Exp $'
  4459 !
  4459 !
  4460 
  4460 
  4461 version_CVS
  4461 version_CVS
  4462     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.285 2012-12-19 09:24:31 stefan Exp $'
  4462     ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.286 2012-12-21 11:58:02 cg Exp $'
  4463 ! !
  4463 ! !
  4464 
  4464 
  4465 
  4465 
  4466 Collection initialize!
  4466 Collection initialize!