Coll.st
changeset 2919 6bb9f0bcb6d2
parent 2665 13998f6189af
child 3061 d42eeace4adf
equal deleted inserted replaced
2918:d4cbb41e38b3 2919:6bb9f0bcb6d2
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
       
    12 
       
    13 'From Smalltalk/X, Version:3.1.10 on 13-sep-1997 at 10:56:49 pm'                !
    12 
    14 
    13 Object subclass:#Collection
    15 Object subclass:#Collection
    14 	instanceVariableNames:''
    16 	instanceVariableNames:''
    15 	classVariableNames:'InvalidKeySignal EmptyCollectionSignal ValueNotFoundSignal
    17 	classVariableNames:'InvalidKeySignal EmptyCollectionSignal ValueNotFoundSignal
    16 		NotEnoughElementsSignal'
    18 		NotEnoughElementsSignal'
   684     |aSortedCollection|
   686     |aSortedCollection|
   685 
   687 
   686     aSortedCollection := SortedCollection sortBlock:sortBlock.
   688     aSortedCollection := SortedCollection sortBlock:sortBlock.
   687     aSortedCollection addAll:self.
   689     aSortedCollection addAll:self.
   688     ^ aSortedCollection
   690     ^ aSortedCollection
       
   691 !
       
   692 
       
   693 asSortedStrings
       
   694     "Create & return a SortedCollection that sorts the receivers
       
   695      elements according to the locales collating policy.
       
   696      This is currently not really support - strings are sorted
       
   697      without caring for the locale."
       
   698 
       
   699     |aSortedCollection|
       
   700 
       
   701     aSortedCollection := SortedCollection forStrings:self size.
       
   702     aSortedCollection addAll:self.
       
   703     ^ aSortedCollection
       
   704 
       
   705     "Created: 13.9.1997 / 09:36:22 / cg"
       
   706     "Modified: 13.9.1997 / 09:43:00 / cg"
       
   707 !
       
   708 
       
   709 asSortedStrings:sortBlock
       
   710     "Create & return a SortedCollection that sorts the receivers
       
   711      elements using sortBlock and according to the locales collating policy.
       
   712      This is currently not really support - strings are sorted
       
   713      without caring for the locale."
       
   714 
       
   715     |aSortedCollection|
       
   716 
       
   717     aSortedCollection := SortedCollection forStrings:self size.
       
   718     aSortedCollection sortBlock:sortBlock.
       
   719     aSortedCollection addAll:self.
       
   720     ^ aSortedCollection
       
   721 
       
   722     "Created: 13.9.1997 / 09:36:45 / cg"
       
   723     "Modified: 13.9.1997 / 09:42:50 / cg"
       
   724 !
       
   725 
       
   726 asSortedStrings:sortBlock with:aCollationPolicy
       
   727     "Create & return a SortedCollection that sorts the receivers
       
   728      elements using sortBlock and according to the specified locales collating policy.
       
   729      This is currently not really support - strings are sorted
       
   730      without caring for the locale."
       
   731 
       
   732     |aSortedCollection|
       
   733 
       
   734     aSortedCollection := SortedCollection forStrings:self size collatedBy:aCollationPolicy.
       
   735     aSortedCollection sortBlock:sortBlock.
       
   736     aSortedCollection addAll:self.
       
   737     ^ aSortedCollection
       
   738 
       
   739     "Created: 13.9.1997 / 09:37:21 / cg"
       
   740     "Modified: 13.9.1997 / 09:45:27 / cg"
       
   741 !
       
   742 
       
   743 asSortedStringsWith: aCollationPolicy
       
   744     "Create & return a SortedCollection that sorts the receivers
       
   745      elements according to the specified locales collating policy.
       
   746      This is currently not really support - strings are sorted
       
   747      without caring for the locale."
       
   748 
       
   749     |aSortedCollection|
       
   750 
       
   751     aSortedCollection := SortedCollection forStrings:self size collatedBy:aCollationPolicy.
       
   752     aSortedCollection addAll:self.
       
   753     ^ aSortedCollection
       
   754 
       
   755     "Created: 13.9.1997 / 09:37:50 / cg"
       
   756     "Modified: 13.9.1997 / 09:44:08 / cg"
   689 !
   757 !
   690 
   758 
   691 asString
   759 asString
   692     "return a String with the collections elements 
   760     "return a String with the collections elements 
   693      (which must convert to characters)"
   761      (which must convert to characters)"
  1635 ! !
  1703 ! !
  1636 
  1704 
  1637 !Collection class methodsFor:'documentation'!
  1705 !Collection class methodsFor:'documentation'!
  1638 
  1706 
  1639 version
  1707 version
  1640     ^ '$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.70 1997-05-26 15:39:16 cg Exp $'
  1708     ^ '$Header: /cvs/stx/stx/libbasic/Attic/Coll.st,v 1.71 1997-09-15 20:28:03 cg Exp $'
  1641 ! !
  1709 ! !
  1642 Collection initialize!
  1710 Collection initialize!